Upgrade CI's clippy to giraffate/clippy-action. #436
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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
name: Continuous Integration | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo check --all-features | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo test | |
- run: cargo test --all-features | |
test-with-features: | |
name: Test With Features | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
features: [serde1, tokio1, serde-transport, tcp] | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo test --manifest-path tarpc/Cargo.toml --features "${{ matrix.example }}" | |
list-examples: | |
name: List Examples | |
runs-on: ubuntu-latest | |
outputs: | |
examples: ${{ steps.matrix.outputs.examples }} | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- id: matrix | |
run: | | |
examples=$( | |
cargo metadata --no-deps --format-version=1 \ | |
| jq '.packages[] | |
| select ( .name == "tarpc" ) | |
| .targets[] | |
| select (.kind[] | . == "example") | |
| .name' \ | |
| jq -s -c '.' | |
) | |
echo "examples=$examples" | tee -a $GITHUB_OUTPUT | |
run-example: | |
name: Run Example | |
needs: list-examples | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
example: ${{ fromJSON(needs.list-examples.outputs.examples) }} | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: | | |
cargo run --example "${{ matrix.example }}" | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous | |
uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- run: cargo clippy --all-features -- -D warnings |