-
Notifications
You must be signed in to change notification settings - Fork 352
104 lines (89 loc) · 3.2 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
---
name: Rust - Run Clippy to check lints
on:
pull_request:
paths:
- .github/workflows/clippy.yml
- clippy.toml
- '**/*.rs'
workflow_dispatch:
jobs:
prepare-android:
name: Prepare Android container
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use custom container image if specified
if: ${{ github.event.inputs.override_container_image != '' }}
run: echo "inner_container_image_android=${{ github.event.inputs.override_container_image }}"
>> $GITHUB_ENV
- name: Use default container image and resolve digest
if: ${{ github.event.inputs.override_container_image == '' }}
run: |
echo "inner_container_image_android=$(cat ./building/android-container-image.txt)" >> $GITHUB_ENV
outputs:
container_image_android: ${{ env.inner_container_image_android }}
clippy-check-desktop:
name: Clippy linting, desktop
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout submodules
run: |
git submodule update --init --depth=1 dist-assets/binaries
git submodule update --init --recursive --depth=1 wireguard-go-rs
- uses: actions-rs/[email protected]
with:
toolchain: stable
components: clippy
override: true
- name: Install build dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libdbus-1-dev
- name: Install Go
if: matrix.os == 'linux-latest' || matrix.os == 'macos-latest'
uses: actions/setup-go@v5
with:
go-version: 1.21.3
- name: Clippy check
shell: bash
env:
RUSTFLAGS: --deny warnings
run: |
source env.sh
time cargo clippy --locked --all-targets --no-default-features
time cargo clippy --locked --all-targets --all-features
clippy-check-android:
name: Clippy linting, Android
needs: prepare-android
runs-on: ubuntu-latest
container:
image: ${{ needs.prepare-android.outputs.container_image_android }}
steps:
# Fix for HOME path overridden by GH runners when building in containers, see:
# https://github.com/actions/runner/issues/863
- name: Fix HOME path
run: echo "HOME=/root" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout wireguard-go submodule
run: |
git config --global --add safe.directory '*'
git submodule update --init --depth=1 wireguard-go-rs
- name: Clippy check
env:
RUSTFLAGS: --deny warnings
run: |
cargo clippy --locked --all-targets --target x86_64-linux-android --package mullvad-jni --no-default-features
cargo clippy --locked --all-targets --target x86_64-linux-android --package mullvad-jni --all-features