Single matrix #525
Workflow file for this run
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: Fmt and Clippy | |
# This job runs rustfmt and clippy linting, | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
workflow_dispatch: # allows manual trigger | |
env: | |
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu | |
RUST_CLIPPY: "1.74" | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
name: 'Detect changes' | |
outputs: | |
crates: ${{ steps.filter.outputs.changes }} | |
steps: | |
# For pull requests it's not necessary to checkout the code | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
wallet-proxy-load-simulator/Cargo.toml: | |
- 'wallet-proxy-load-simulator/**' | |
- '.github/**' | |
state-compare/Cargo.toml: | |
- 'state-compare/**' | |
- '.github/**' | |
genesis-creator/Cargo.toml: | |
- 'genesis-creator/**' | |
- '.github/**' | |
id-verifier/Cargo.toml: | |
- 'id-verifier/**' | |
- '.github/**' | |
kpi-tracker/Cargo.toml: | |
- 'kpi-tracker/**' | |
- '.github/**' | |
chain-prometheus-exporter/Cargo.toml: | |
- 'chain-prometheus-exporter/**' | |
- '.github/**' | |
recover-id-object/Cargo.toml: | |
- 'recover-id-object/**' | |
- '.github/**' | |
generator/Cargo.toml: | |
- 'generator/**' | |
- '.github/**' | |
wallet-connect-test-bench/smart-contract/Cargo.toml | |
- 'wallet-connect-test-bench/**' | |
- '.github/**' | |
notification-server/Cargo.toml: | |
- 'notification-server/**' | |
- '.github/**' | |
"lint_fmt": | |
name: lint:fmt | |
runs-on: ubuntu-latest | |
if: needs.changes.outputs.crates != '[]' | |
strategy: | |
fail-fast: false | |
matrix: | |
crates: ${{ fromJSON(needs.changes.outputs.crates) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
run: | | |
rustup default ${{ env.RUST_FMT }} | |
rustup component add rustfmt | |
- name: Format | |
run: | | |
cargo fmt --manifest-path=${{ matrix.crates }} -- --check | |
"lint_clippy": | |
name: lint:clippy | |
needs: "lint_fmt" | |
if: needs.changes.outputs.crates != '[]' | |
strategy: | |
fail-fast: false | |
matrix: | |
crates: ${{ fromJSON(needs.changes.outputs.crates) }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Rust | |
run: | | |
rustup default ${{ env.RUST_CLIPPY }} | |
rustup component add clippy | |
- name: Clippy | |
run: | | |
cargo clippy --manifest-path ${{ matrix.crates }} --locked -- -D warnings | |