]> git.lizzy.rs Git - rust.git/blob - .github/workflows/clippy.yml
Auto merge of #6765 - camsteffen:unnecessary-wraps-pedantic, r=flip1995
[rust.git] / .github / workflows / clippy.yml
1 name: Clippy Test
2
3 on:
4   push:
5     # Ignore bors branches, since they are covered by `clippy_bors.yml`
6     branches-ignore:
7       - auto
8       - try
9     # Don't run Clippy tests, when only textfiles were modified
10     paths-ignore:
11     - 'COPYRIGHT'
12     - 'LICENSE-*'
13     - '**.md'
14     - '**.txt'
15   pull_request:
16     # Don't run Clippy tests, when only textfiles were modified
17     paths-ignore:
18     - 'COPYRIGHT'
19     - 'LICENSE-*'
20     - '**.md'
21     - '**.txt'
22
23 env:
24   RUST_BACKTRACE: 1
25   CARGO_TARGET_DIR: '${{ github.workspace }}/target'
26   NO_FMT_TEST: 1
27
28 jobs:
29   base:
30     runs-on: ubuntu-latest
31
32     steps:
33     # Setup
34     - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
35       with:
36         github_token: "${{ secrets.github_token }}"
37
38     - name: Checkout
39       uses: actions/checkout@v2.3.3
40
41     - name: Install toolchain
42       run: rustup show active-toolchain
43
44     # Run
45     - name: Set LD_LIBRARY_PATH (Linux)
46       run: |
47         SYSROOT=$(rustc --print sysroot)
48         echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
49
50     - name: Build
51       run: cargo build --features deny-warnings,internal-lints
52
53     - name: Test "--fix -Zunstable-options"
54       run: cargo run --features deny-warnings,internal-lints --bin cargo-clippy -- clippy --fix -Zunstable-options
55
56     - name: Test Workspace
57       run: cargo test --all --features deny-warnings,internal-lints
58
59     - name: Test clippy_dev
60       run: cargo test --features deny-warnings
61       working-directory: clippy_dev
62
63     - name: Test cargo-clippy
64       run: ../target/debug/cargo-clippy
65       working-directory: clippy_workspace_tests
66
67     - name: Test clippy-driver
68       run: bash .github/driver.sh
69       env:
70         OS: ${{ runner.os }}
71
72     - name: Test cargo dev new lint
73       run: |
74         cargo dev new_lint --name new_early_pass --pass early
75         cargo dev new_lint --name new_late_pass --pass late
76         cargo check
77         git reset --hard HEAD