]> git.lizzy.rs Git - rust.git/blob - .github/workflows/clippy.yml
Revert "Test workspace at once"
[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
57       run: cargo test --features deny-warnings,internal-lints
58
59     - name: Test clippy_lints
60       run: cargo test --features deny-warnings,internal-lints
61       working-directory: clippy_lints
62
63     - name: Test rustc_tools_util
64       run: cargo test --features deny-warnings
65       working-directory: rustc_tools_util
66
67     - name: Test clippy_dev
68       run: cargo test --features deny-warnings
69       working-directory: clippy_dev
70
71     - name: Test cargo-clippy
72       run: ../target/debug/cargo-clippy
73       working-directory: clippy_workspace_tests
74
75     - name: Test clippy-driver
76       run: bash .github/driver.sh
77       env:
78         OS: ${{ runner.os }}
79
80     - name: Test cargo dev new lint
81       run: |
82         cargo dev new_lint --name new_early_pass --pass early
83         cargo dev new_lint --name new_late_pass --pass late
84         cargo check
85         git reset --hard HEAD