]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/.github/workflows/clippy.yml
Auto merge of #77692 - PankajChaudhary5:issue-76630, r=davidtwco
[rust.git] / src / tools / clippy / .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
54       run: cargo test --features deny-warnings,internal-lints
55
56     - name: Test clippy_lints
57       run: cargo test --features deny-warnings,internal-lints
58       working-directory: clippy_lints
59
60     - name: Test rustc_tools_util
61       run: cargo test --features deny-warnings
62       working-directory: rustc_tools_util
63
64     - name: Test clippy_dev
65       run: cargo test --features deny-warnings
66       working-directory: clippy_dev
67
68     - name: Test cargo-clippy
69       run: ../target/debug/cargo-clippy
70       working-directory: clippy_workspace_tests
71
72     - name: Test clippy-driver
73       run: bash .github/driver.sh
74       env:
75         OS: ${{ runner.os }}
76
77     - name: Test cargo dev new lint
78       run: |
79         cargo dev new_lint --name new_early_pass --pass early
80         cargo dev new_lint --name new_late_pass --pass late
81         cargo check
82         git reset --hard HEAD