-
Notifications
You must be signed in to change notification settings - Fork 148
87 lines (75 loc) · 2.33 KB
/
build-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
86
87
name: Build Check
on:
pull_request:
branches: [ main ]
paths:
- 'src-tauri/**'
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 1
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: 1
RUSTC_WRAPPER: sccache
CARGO_BUILD_JOBS: 2
jobs:
build:
name: Build Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Cache Linux Dependencies
id: cache-apt
uses: actions/cache@v3
with:
path: |
/var/cache/apt/archives/*.deb
/var/lib/apt/lists/*
key: ${{ runner.os }}-apt-${{ hashFiles('**/build-check.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install Linux Dependencies
run: |
sudo rm -rf /var/cache/apt/archives/lock
sudo rm -rf /var/cache/apt/archives/partial
sudo rm -rf /var/lib/apt/lists/lock
sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential \
pkg-config \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libglib2.0-dev \
libjavascriptcoregtk-4.0-dev \
libsoup-3.0-dev \
libwebkit2gtk-4.1-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: cargo
target: x86_64-unknown-linux-gnu
- name: Install sccache
run: |
SCCACHE_VERSION=v0.7.7
curl -L "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar xz
sudo mv sccache-*/sccache /usr/local/bin/sccache
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- uses: Swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
shared-key: "build"
- name: Install Dependencies
run: npm ci
- name: Build Application
run: |
npm run tauri build -- \
--target x86_64-unknown-linux-gnu \
--bundles deb \
--ci