forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (100 loc) · 2.95 KB
/
clippy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Clippy Test
on:
push:
# Ignore bors branches, since they are covered by `clippy_bors.yml`
branches-ignore:
- auto
- try
# Don't run Clippy tests, when only text files were modified
paths-ignore:
- 'COPYRIGHT'
- 'LICENSE-*'
- '**.md'
- '**.txt'
pull_request:
# Don't run Clippy tests, when only text files were modified
paths-ignore:
- 'COPYRIGHT'
- 'LICENSE-*'
- '**.md'
- '**.txt'
env:
RUST_BACKTRACE: 1
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
NO_FMT_TEST: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
concurrency:
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
# If the push is not attached to a PR, we will cancel all builds on the same branch.
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
jobs:
base:
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout
uses: actions/checkout@v4
- name: Install toolchain
run: rustup show active-toolchain
# Run
- name: Build
run: cargo build --tests --features internal
- name: Test
run: cargo test --features internal
- name: Test clippy_lints
run: cargo test --features internal
working-directory: clippy_lints
- name: Test clippy_utils
run: cargo test
working-directory: clippy_utils
- name: Test rustc_tools_util
run: cargo test
working-directory: rustc_tools_util
- name: Test clippy_dev
run: cargo test
working-directory: clippy_dev
- name: Test clippy-driver
run: .github/driver.sh
env:
OS: ${{ runner.os }}
base-2024:
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout
uses: actions/checkout@v4
- name: Select Rust 2024 edition
run: |
for i in clippy_config clippy_dev clippy_lints clippy_utils lintcheck; do
sed -i \
-e '1icargo-features = ["edition2024"]' \
-e 's/edition = "2021"/edition = "2024"/' \
$i/Cargo.toml
done
- name: Install toolchain
run: rustup show active-toolchain
# Run
- name: Build
run: cargo build --tests --features internal
- name: Test
run: cargo test --features internal
- name: Test clippy_lints
run: cargo test --features internal
working-directory: clippy_lints
- name: Test clippy_utils
run: cargo test
working-directory: clippy_utils
- name: Test rustc_tools_util
run: cargo test
working-directory: rustc_tools_util
- name: Test clippy_dev
run: cargo test
working-directory: clippy_dev
- name: Test clippy-driver
run: .github/driver.sh
env:
OS: ${{ runner.os }}