Merge pull request #23 from rursprung/dependabot/github_actions/githu… #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
permissions: | |
security-events: write # needed to upload SARIF reports on branch builds | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
rust: [1.56.0, stable] | |
features: ['', '--all-features'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: rustfmt clippy | |
- name: use MSRV-compatible dependencies for MSRV check | |
if: ${{ matrix.os != 'stable' }} | |
run: cp Cargo.lock.rust-msrv Cargo.lock | |
- name: build | |
run: cargo build ${{ matrix.features }} | |
- name: check | |
run: cargo check ${{ matrix.features }} | |
- name: test | |
run: cargo test ${{ matrix.features }} | |
- name: check formatting | |
run: cargo fmt --all -- --check | |
- name: audit | |
run: cargo audit --ignore RUSTSEC-2020-0071 # time 0.1, pulled in through chrono which however doesn't use the affected API. see https://github.com/chronotope/chrono/issues/602 | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install required cargo components | |
run: cargo install clippy-sarif sarif-fmt | |
- name: clippy | |
run: cargo clippy --features --all-features --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: rust-clippy-results.sarif | |
wait-for-processing: true |