|
| 1 | +name: Check Clippy all-features |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + get-head-commit-msg: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + outputs: |
| 10 | + head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }} |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + with: |
| 14 | + ref: ${{ github.event.pull_request.head.sha }} |
| 15 | + |
| 16 | + - name: Get Head Commit Message |
| 17 | + id: step-head-commit |
| 18 | + run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" |
| 19 | + |
| 20 | + check-clippy-all-features: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + needs: get-head-commit-msg |
| 23 | + if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }} |
| 24 | + steps: |
| 25 | + - name: Free Disk Space |
| 26 | + uses: jlumbroso/free-disk-space@main |
| 27 | + with: |
| 28 | + tool-cache: true |
| 29 | + |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Set up Cargo Cache |
| 34 | + uses: actions/cache@v4 |
| 35 | + with: |
| 36 | + path: | |
| 37 | + ~/.cargo/bin/ |
| 38 | + ~/.cargo/registry/index/ |
| 39 | + ~/.cargo/registry/cache/ |
| 40 | + ~/.cargo/git/db/ |
| 41 | + key: $ ${{ github.job }}-${{ github.ref }}-clippy-all-features-${{ hashFiles('**/Cargo.lock') }} |
| 42 | + restore-keys: | |
| 43 | + $ ${{ github.job }}-${{ github.ref }}-clippy-all-features- |
| 44 | +
|
| 45 | + - name: Set up Docker Buildx |
| 46 | + uses: docker/setup-buildx-action@v3 |
| 47 | + |
| 48 | + - name: Run Clippy |
| 49 | + run: | |
| 50 | + docker run --rm \ |
| 51 | + -v "${GITHUB_WORKSPACE}:/workspace" \ |
| 52 | + -v "${HOME}/.cargo:/root/.cargo" \ |
| 53 | + -w /workspace \ |
| 54 | + -e RUSTDOCFLAGS='-D warnings' \ |
| 55 | + -e SKIP_WASM_BUILD=1 \ |
| 56 | + paritytech/ci-unified:bullseye-1.74.0 \ |
| 57 | + bash -c " |
| 58 | + cargo clippy --all-targets --all-features --locked --quiet && \ |
| 59 | + chown -R $(id -u):$(id -g) target/" |
| 60 | +
|
0 commit comments