]> git.lizzy.rs Git - rust.git/blob - .github/workflows/clippy_dev.yml
Move CI tests for collect-metadata to clippy_bors.yml
[rust.git] / .github / workflows / clippy_dev.yml
1 name: Clippy Dev Test
2
3 on:
4   push:
5     branches:
6       - auto
7       - try
8   pull_request:
9     # Only run on paths, that get checked by the clippy_dev tool
10     paths:
11     - 'CHANGELOG.md'
12     - 'README.md'
13     - '**.stderr'
14     - '**.rs'
15
16 env:
17   RUST_BACKTRACE: 1
18   CARGO_INCREMENTAL: 0
19   CARGO_UNSTABLE_SPARSE_REGISTRY: true
20
21 jobs:
22   clippy_dev:
23     runs-on: ubuntu-latest
24
25     steps:
26     # Setup
27     - name: Checkout
28       uses: actions/checkout@v3.0.2
29
30     # Run
31     - name: Build
32       run: cargo build --features deny-warnings
33       working-directory: clippy_dev
34
35     - name: Test update_lints
36       run: cargo dev update_lints --check
37
38     - name: Test fmt
39       run: cargo dev fmt --check
40
41     - name: Test cargo dev new lint
42       run: |
43         cargo dev new_lint --name new_early_pass --pass early
44         cargo dev new_lint --name new_late_pass --pass late
45         cargo check
46         git reset --hard HEAD
47
48   # These jobs doesn't actually test anything, but they're only used to tell
49   # bors the build completed, as there is no practical way to detect when a
50   # workflow is successful listening to webhooks only.
51   #
52   # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
53
54   end-success:
55     name: bors dev test finished
56     if: github.event.pusher.name == 'bors' && success()
57     runs-on: ubuntu-latest
58     needs: [clippy_dev]
59
60     steps:
61       - name: Mark the job as successful
62         run: exit 0
63
64   end-failure:
65     name: bors dev test finished
66     if: github.event.pusher.name == 'bors' && (failure() || cancelled())
67     runs-on: ubuntu-latest
68     needs: [clippy_dev]
69
70     steps:
71       - name: Mark the job as a failure
72         run: exit 1