Skip to content

Commit

Permalink
add some workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes committed Nov 10, 2023
1 parent c9b18d7 commit aeb14a8
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# disable until I don't get spam of notification (. before filename)

version: 2
updates:
- package-ecosystem: cargo
directory: .
schedule:
interval: monthly
27 changes: 27 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: Format
jobs:
fmt_clippy:
name: Format + Clippy
runs-on: ubuntu-latest
environment: dev
strategy:
matrix:
rust: [ nightly ]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
components: rustfmt, clippy
- uses: actions/checkout@master
- name: cargo format + clippy
run: cargo fmt --all -- --check && cargo clippy --all
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: Test
jobs:
test_linux:
name: Test on Ubuntu
runs-on: ubuntu-latest
environment: dev
strategy:
matrix:
rust: [ nightly ]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@master
- name: Run tests
run: |
cargo test --all --all-features
51 changes: 51 additions & 0 deletions .github/workflows/upload_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Upload artifacts'
on:
workflow_dispatch:
permissions:
contents: write
jobs:
upload_linux_artifact:
runs-on: "ubuntu-latest"
strategy:
matrix:
rust: [ nightly ]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- uses: actions/checkout@master
- name: build libsensors
run: |
make libsensors
- name: build release
run: |
cargo build --release
- name: Upload Linux artifact
uses: actions/[email protected]
with:
name: fan-control
path: target/release/fan-control

# TODO: experiment cross compile: linux -> win
upload_linux_artifact:
runs-on: "windows-latest"
strategy:
matrix:
rust: [ nightly ]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- uses: actions/checkout@master
- name: build lhm
run: |
cd LibreHardwareMonitorWrapper
dotnet build
- name: build release
run: |
cargo build --release
- name: Upload Linux artifact
uses: actions/[email protected]
with:
name: fan-control
path: target/release/fan-control

0 comments on commit aeb14a8

Please sign in to comment.