-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (88 loc) · 2.69 KB
/
ci-rust.yml
File metadata and controls
93 lines (88 loc) · 2.69 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
name: CI:Rust
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ci-rust-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NODE_OPTIONS: '--max_old_space_size=4096'
VITEST_SEGFAULT_RETRY: 3
jobs:
rust-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
version: 1.0
- name: Rust setup
uses: moonrepo/setup-rust@v1
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
cache-bin: false
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn' # Set this to npm, yarn or pnpm.
- name: Install app dependencies and build web
run: yarn && yarn build
- name: Run rust test
working-directory: src-tauri
run: cargo test
rust-fmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
version: 1.0
- name: Rust setup
uses: moonrepo/setup-rust@v1
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
cache-bin: false
- run: rustup component add rustfmt
- name: Run rust fmt
working-directory: src-tauri
run: cargo fmt --all --check
rust-clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
version: 1.0
- name: Rust setup
uses: moonrepo/setup-rust@v1
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
cache-bin: false
- run: rustup component add clippy
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn' # Set this to npm, yarn or pnpm.
- name: Install app dependencies and build web
run: yarn && yarn build
- name: Run clippy
working-directory: src-tauri
run: cargo clippy