-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
85 lines (78 loc) · 2.58 KB
/
rust-code-quality-check.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
name: Check Rust Code
on:
push:
pull_request:
workflow_dispatch:
permissions:
actions: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
working-directory: src-tauri
jobs:
cargo-test:
name: Test codebase on ${{ matrix.os }} (cargo test)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: rui314/setup-mold@v1
- uses: taiki-e/install-action@v1
with:
tool: cargo-hack,nextest
- name: Install dependencies for Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra
version: 1.0
- name: Run unit & integration tests with nextest
run: cargo hack --feature-powerset --exclude-features cli-build nextest run
# - name: Run documentation tests with cargo test
# run: cargo hack --feature-powerset test --doc
cargo-clippy:
name: Check codebase quality (cargo clippy)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- uses: taiki-e/install-action@cargo-hack
- name: Install dependencies for Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra
version: 1.0
- name: Run all-features code quality checks
run: cargo hack --feature-powerset --exclude-features cli-build --no-dev-deps clippy
- name: Run normal code quality check
run: cargo clippy
cargo-fmt:
name: Enforce codebase style (cargo fmt)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- run: cargo fmt --all -- --color=always --check