summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/testframework-clippy.yml
blob: b4cd42e43fb55c0eed75df9c1f1dc0543d4a89d0 (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
# Run `clippy` on the `test` workspace
---
name: DES Testframework - Clippy
on:
  pull_request:
    paths:
      - 'test/**/*.rs'
      - .github/workflows/clippy-test.yml
      - clippy.toml
  workflow_dispatch:

permissions: {}

jobs:
  clippy-check-test:
    name: Clippy linting of test workspace
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - uses: ./.github/actions/mullvad-build-env
        with:
          rustup-components: clippy

      - name: Clippy check
        working-directory: test
        shell: bash
        env:
          RUSTFLAGS: --deny warnings
        run: |
          time cargo clippy --locked --all-targets --no-default-features
          time cargo clippy --locked --all-targets --all-features

  clippy-check-test-windows:
    name: Clippy linting of test workspace (Windows)
    runs-on: windows-latest
    steps:
      # By default, the longest path a filename can have in git on Windows is 260 character.
      - name: Set git config for long paths
        run: |
          git config --system core.longpaths true

      - name: Checkout repository
        uses: actions/checkout@v4

      - uses: ./.github/actions/mullvad-build-env
        with:
          rustup-components: clippy

      - name: Clippy check
        working-directory: test
        shell: bash
        env:
          RUSTFLAGS: --deny warnings
        run: |
          # Exclude checking test-manager on Windows, since it is not a supported compilation target.
          time cargo clippy  --all-targets --workspace --exclude test-manager --locked --no-default-features
          time cargo clippy  --all-targets --workspace --exclude test-manager --locked --all-features