ci: use rust action

This commit is contained in:
daimond113 2024-10-30 19:56:12 +01:00
parent 678430f96f
commit 7057211564
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 14 additions and 13 deletions

View file

@ -33,6 +33,7 @@ jobs:
name: Build for ${{ matrix.host }}-${{ matrix.arch }} name: Build for ${{ matrix.host }}-${{ matrix.arch }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Set env - name: Set env
shell: bash shell: bash
run: | run: |
@ -80,6 +81,7 @@ jobs:
needs: [ build ] needs: [ build ]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Publish - name: Publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty --locked run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty --locked

View file

@ -11,19 +11,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Rust - uses: dtolnay/rust-toolchain@stable
uses: moonrepo/setup-rust@v1
with: with:
bins: cargo-tarpaulin components: clippy, rustfmt
components: rustfmt, clippy
- name: Install OS dependencies - name: Install OS dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install libdbus-1-dev pkg-config sudo apt-get install libdbus-1-dev pkg-config
- name: Run tests # pesde currently does not have any tests. Bring this back when (if) tests are added.
run: cargo test --all --all-features # - name: Run tests
# run: cargo test --all --all-features
- name: Check formatting - name: Check formatting
run: cargo fmt --all -- --check run: cargo fmt --all -- --check
@ -31,10 +30,10 @@ jobs:
- name: Run clippy - name: Run clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings run: cargo clippy --all --all-targets --all-features -- -D warnings
- name: Generate coverage report # - name: Generate coverage report
run: cargo tarpaulin --all-features --out xml --exclude-files src/cli/* --exclude-files registry/* --exclude-files src/main.rs --skip-clean # run: cargo tarpaulin --all-features --out xml --exclude-files src/cli/* --exclude-files registry/* --exclude-files src/main.rs --skip-clean
#
- name: Upload coverage reports to Codecov # - name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1 # uses: codecov/codecov-action@v4.0.1
with: # with:
token: ${{ secrets.CODECOV_TOKEN }} # token: ${{ secrets.CODECOV_TOKEN }}