summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/.github/workflows/clippy.yml
blob: b992130119713b0408b76341873995a28a5c5e38 (plain)
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
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
  CARGO_UNSTABLE_SPARSE_REGISTRY: 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
    - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
      with:
        github_token: "${{ secrets.github_token }}"

    - name: Checkout
      uses: actions/checkout@v3.0.2

    - name: Install toolchain
      run: rustup show active-toolchain

    # Run
    - name: Set LD_LIBRARY_PATH (Linux)
      run: |
        SYSROOT=$(rustc --print sysroot)
        echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV

    - name: Build
      run: cargo build --features deny-warnings,internal

    - name: Test
      run: cargo test --features deny-warnings,internal

    - name: Test clippy_lints
      run: cargo test --features deny-warnings,internal
      working-directory: clippy_lints

    - name: Test clippy_utils
      run: cargo test --features deny-warnings,internal
      working-directory: clippy_utils

    - name: Test rustc_tools_util
      run: cargo test --features deny-warnings
      working-directory: rustc_tools_util

    - name: Test clippy_dev
      run: cargo test --features deny-warnings
      working-directory: clippy_dev

    - name: Test clippy-driver
      run: bash .github/driver.sh
      env:
        OS: ${{ runner.os }}