-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (125 loc) · 3.84 KB
/
test_build.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: 'test-build'
# This should ensure that the workflow won't run on `dev-*` branches, but will
# otherwise execute on any other branch and any pull request (including PRs
# from dev branches).
on:
push:
branches-ignore:
- 'dev-*'
pull_request:
branches:
- '*'
env:
RUST_VERSION: "1.72.0"
NODE_VERSION: "18"
# To build on latest ubuntu, some more dependencies are missing.
# So for now (before we figure out what there are), we are using
# ubuntu 20.04 everywhere.
jobs:
# Check Rust code formatting.
formatting:
name: "Check Rust code formatting"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- run: cargo fmt --all -- --check
# Check Rust code validity.
validity:
needs: formatting
name: "Check Rust code validity"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- run: cargo check --all-features
# Run all tests in the Rust project (if any).
test:
needs: validity
name: "Run Rust test suite"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- run: cargo test --all-features
# Check Rust code style with clippy.
clippy:
needs: validity
name: "Check Rust code using clippy"
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
working-directory: ./src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- run: cargo clippy --all-features
# Try to build the app on all platforms to make sure there is nothing
# wrong with the frontend integration and tauri config in general.
test-build:
name: "Multiplatform build"
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install tauri
run: npm install
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}