Repository navigation
97 lines (80 loc) · 2.22 KB
/
Copy pathpr-check.yml
File metadata and controls
97 lines (80 loc) · 2.22 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
name: PR 检查
on:
pull_request:
branches:
- main
- master
- dev
push:
branches:
- main
- master
- dev
permissions:
contents: read
jobs:
test-build:
strategy:
fail-fast: false
matrix:
include:
- platform: windows
arch: x86_64
runner: windows-latest
- platform: macos
arch: x86_64
runner: macos-15-intel
- platform: macos
arch: aarch64
runner: macos-latest
- platform: linux
arch: x86_64
runner: ubuntu-22.04
runs-on: ${{ matrix.runner }}
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 安装 Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: 安装 Rust 稳定版
uses: dtolnay/rust-toolchain@stable
- name: 安装 pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: 获取 pnpm store 目录
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: 设置 pnpm 缓存
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Rust 缓存
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: 安装 Ubuntu 依赖
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libsoup2.4-dev
- name: 安装前端依赖
run: pnpm install
- name: 类型检查
run: pnpm run build
- name: Tauri 构建测试
run: pnpm run tauri build
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}-build
path: src-tauri/target/release/bundle/
if-no-files-found: warn
retention-days: 7