]> git.lizzy.rs Git - rust.git/blob - .github/workflows/clippy.yml
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
[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     # NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
31     runs-on: ubuntu-latest
32
33     steps:
34     # Setup
35     - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
36       with:
37         github_token: "${{ secrets.github_token }}"
38
39     - name: Checkout
40       uses: actions/checkout@v2.3.3
41
42     - name: Install toolchain
43       run: rustup show active-toolchain
44
45     # Run
46     - name: Set LD_LIBRARY_PATH (Linux)
47       run: |
48         SYSROOT=$(rustc --print sysroot)
49         echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
50
51     - name: Build
52       run: cargo build --features deny-warnings,internal-lints,metadata-collector-lint
53
54     - name: Test
55       run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
56
57     - name: Test clippy_lints
58       run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
59       working-directory: clippy_lints
60
61     - name: Test clippy_utils
62       run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
63       working-directory: clippy_utils
64
65     - name: Test rustc_tools_util
66       run: cargo test --features deny-warnings
67       working-directory: rustc_tools_util
68
69     - name: Test clippy_dev
70       run: cargo test --features deny-warnings
71       working-directory: clippy_dev
72
73     - name: Test cargo-clippy
74       run: ../target/debug/cargo-clippy
75       working-directory: clippy_workspace_tests
76
77     - name: Test cargo-clippy --fix
78       run: ../target/debug/cargo-clippy clippy --fix
79       working-directory: clippy_workspace_tests
80
81     - name: Test clippy-driver
82       run: bash .github/driver.sh
83       env:
84         OS: ${{ runner.os }}
85
86     - name: Test cargo dev new lint
87       run: |
88         cargo dev new_lint --name new_early_pass --pass early
89         cargo dev new_lint --name new_late_pass --pass late
90         cargo check
91         git reset --hard HEAD