diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..458234ce --- /dev/null +++ b/.github/dependabot.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..092eef31 --- /dev/null +++ b/.github/workflows/format.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c50a84f2 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/upload_artifacts.yml b/.github/workflows/upload_artifacts.yml new file mode 100644 index 00000000..843077b7 --- /dev/null +++ b/.github/workflows/upload_artifacts.yml @@ -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/upload-artifact@v3.1.2 + 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/upload-artifact@v3.1.2 + with: + name: fan-control + path: target/release/fan-control \ No newline at end of file