diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..25ae3a2 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,25 @@ +name: Mark stale issues and pull requests + +# Please refer to https://github.com/actions/stale/blob/master/action.yml +# to see all config knobs of the stale action. + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'A friendly reminder that this issue had no activity for 30 days.' + stale-pr-message: 'A friendly reminder that this PR had no activity for 30 days.' + stale-issue-label: 'stale-issue' + stale-pr-label: 'stale-pr' + days-before-stale: 30 + days-before-close: 365 + remove-stale-when-updated: true \ No newline at end of file diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml new file mode 100644 index 0000000..28757e4 --- /dev/null +++ b/.github/workflows/validation.yml @@ -0,0 +1,54 @@ +name: validation +on: + pull_request: + push: + branches: [ main ] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 + + DCO-check: + runs-on: ubuntu-latest + steps: + - name: get pr commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@v1.3.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: DCO check + uses: tim-actions/dco@master + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + + - name: check subject line length + uses: tim-actions/commit-message-checker-with-regex@v0.3.2 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^.{0,72}(\n.*)*$' + error: 'Subject too long (max 72)' + + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: make validate + + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: make test diff --git a/examples/clocksource.rs b/examples/clocksource.rs index d01f699..45f1fb0 100644 --- a/examples/clocksource.rs +++ b/examples/clocksource.rs @@ -8,7 +8,7 @@ fn main() { for clock_src in &clocksources { println!("name: {}", clock_src.name()); println!( - "avaiable clocksource: {}", + "available clocksource: {}", clock_src.available_clocksource().join(" "), ); println!("current clocksource: {}", clock_src.current_clocksource()); diff --git a/src/sysfs/class_thermal.rs b/src/sysfs/class_thermal.rs index a77f18e..7b22a83 100644 --- a/src/sysfs/class_thermal.rs +++ b/src/sysfs/class_thermal.rs @@ -12,7 +12,7 @@ enum ThermalZoneInfo { Policy, Mode, Passive, - Unkown, + Unknown, } impl ThermalZoneInfo { @@ -23,7 +23,7 @@ impl ThermalZoneInfo { "policy" => ThermalZoneInfo::Policy, "mode" => ThermalZoneInfo::Mode, "passive" => ThermalZoneInfo::Passive, - _ => ThermalZoneInfo::Unkown, + _ => ThermalZoneInfo::Unknown, } } } @@ -136,7 +136,7 @@ pub fn collect() -> Vec { thermal_device.zone_type = c; } } - ThermalZoneInfo::Unkown => {} + ThermalZoneInfo::Unknown => {} } } diff --git a/src/sysfs/clocksource.rs b/src/sysfs/clocksource.rs index 03a4f8f..05c44da 100644 --- a/src/sysfs/clocksource.rs +++ b/src/sysfs/clocksource.rs @@ -31,7 +31,7 @@ impl ClocksourceInfo { /// /// for clock_src in clocksources { /// println!("name: {}", clock_src.name()); -/// println!("avaiable clocksource: {:?}", clock_src.available_clocksource()); +/// println!("available clocksource: {:?}", clock_src.available_clocksource()); /// println!("current clocksource: {}", clock_src.current_clocksource()); /// } ///