-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (86 loc) · 2.81 KB
/
Copy pathci-rs.yml
File metadata and controls
101 lines (86 loc) · 2.81 KB
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
name: CI - Rust
on:
push:
branches:
- main
paths:
- "src-tauri/**"
- ".github/workflows/ci-rs.yml"
pull_request:
branches:
- main
paths:
- "src-tauri/**"
- ".github/workflows/ci-rs.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: ./src-tauri
jobs:
setup:
name: Setup rust, clippy and rustfmt
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Install required dependencies by Tauri
uses: ./.github/actions/pre-setup-tauri
- name: Setup rust
uses: ./.github/actions/setup-rust
with:
toolchain: nightly
target: x86_64-unknown-linux-gnu
components: clippy, rustfmt
rustflags: ${{ vars.BUILD_CONTINUE_ON_ERROR != 'true' && '-Dwarnings' || '' }}
workspaces: src-tauri
- name: Build project
run: make build
lint:
name: Perform lint
runs-on: ubuntu-24.04
needs:
- setup
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Install required dependencies by Tauri
uses: ./.github/actions/pre-setup-tauri
- name: Setup rust
uses: ./.github/actions/setup-rust
with:
toolchain: nightly
target: x86_64-unknown-linux-gnu
components: clippy, rustfmt
rustflags: ${{ vars.BUILD_CONTINUE_ON_ERROR != 'true' && '-Dwarnings' || '' }}
workspaces: src-tauri
- name: Run linter
continue-on-error: ${{ vars.BUILD_CONTINUE_ON_ERROR == 'true' }}
uses: clechasseur/rs-clippy-check@50a0fd6f2f1a33307d603ee50d91eadbb2561120 # v3.0.6
with:
args: --all-features --no-deps
working-directory: ./src-tauri
format:
name: Perform format
runs-on: ubuntu-24.04
needs:
- setup
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Install required dependencies by Tauri
uses: ./.github/actions/pre-setup-tauri
- name: Setup rust
uses: ./.github/actions/setup-rust
with:
toolchain: nightly
target: x86_64-unknown-linux-gnu
components: clippy, rustfmt
rustflags: ${{ vars.BUILD_CONTINUE_ON_ERROR != 'true' && '-Dwarnings' || '' }}
workspaces: src-tauri
- name: Run formatter
continue-on-error: ${{ vars.BUILD_CONTINUE_ON_ERROR == 'true' }}
uses: actions-rust-lang/rustfmt@559aa3035a47390ba96088dffa783b5d26da9326 # v1.1.1
with:
manifest-path: ./src-tauri/Cargo.toml