-
Notifications
You must be signed in to change notification settings - Fork 57
86 lines (70 loc) · 2.12 KB
/
test.yml
File metadata and controls
86 lines (70 loc) · 2.12 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
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancel prev CI if new commit come (learned from ant-design repo)
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install
- name: Lint JavaScript/TypeScript Frontend
run: npx eslint 'src/**/*.{js,jsx,ts,tsx}' --no-fix --max-warnings=0
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Lint Rust Backend
run: |
find src-tauri/src -name '*.rs' | xargs rustfmt --check
Build:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
# - platform: macos-latest
# args: '--target aarch64-apple-darwin'
- platform: 'ubuntu-latest'
args: ''
# - platform: 'windows-latest'
# args: ''
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin' || '' }}
- uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
key: ${{ matrix.platform }}-${{ matrix.args }}
- name: Test Build
run: npx tauri build ${{ matrix.args }}
env:
SJMCL_CURSEFORGE_API_KEY: ${{ secrets.SJMCL_CURSEFORGE_API_KEY }}