Skip to content

Commit

Permalink
Fix branch and add badges and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed May 5, 2024
1 parent da450a0 commit e494537
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and test rust code

on:
push:
pull_request:

permissions:
contents: read

jobs:
build_and_test:
runs-on: ubuntu-latest
name: Build and test binary
steps:
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.76
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --release
16 changes: 15 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include = [
]

[badges]
github = { repository = "ipmitool-dcmi-power-reading", branch = "master" }
github = { repository = "ipmitool-dcmi-power-reading", branch = "main" }
is-it-maintained-issue-resolution = { repository = "ipmitool-dcmi-power-reading" }
is-it-maintained-open-issues = { repository = "ipmitool-dcmi-power-reading" }
maintenance = { status = "passively-maintained" }
Expand All @@ -35,6 +35,20 @@ lto = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.deb]
maintainer = "William Desportes <[email protected]>"
copyright = "2024, William Desportes <[email protected]>"
license-file = ["LICENSE"]
extended-description = """\
The Rust implementation of \"ipmitool dcmi power reading\""""
depends = "$auto"
section = "utility"
priority = "optional"
assets = [
["target/release/cargo-deb", "usr/bin/ipmitool-dcmi-power-reading", "755"],
["README.md", "usr/share/doc/ipmitool-dcmi-power-reading/README", "644"],
]

[dependencies]
ipmi-rs = "0.2.1"
pretty_env_logger = "0.4"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ipmitool dcmi power reading

[![dependency status](https://deps.rs/repo/github/wdes/ipmitool-dcmi-power-reading/status.svg)](https://deps.rs/repo/github/wdes/ipmitool-dcmi-power-reading)
[![Build and test rust code](https://github.com/wdes/ipmitool-dcmi-power-reading/actions/workflows/rust.yml/badge.svg)](https://github.com/wdes/ipmitool-dcmi-power-reading/actions/workflows/rust.yml)
![maintenance-status](https://img.shields.io/badge/maintenance-passively--maintained-yellowgreen.svg)

## Why does this tool exist

Because you are asking yourself "how do I get my power consumption numbers" ?
Expand Down

0 comments on commit e494537

Please sign in to comment.