-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (144 loc) · 4.35 KB
/
ci.yml
File metadata and controls
168 lines (144 loc) · 4.35 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
env:
ELECTRON_CACHE: ~/.cache/electron
ELECTRON_BUILDER_CACHE: ~/.cache/electron-builder
jobs:
lint:
name: Lint & Quality Checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
fetch-depth: 0
- name: Setup Task
uses: go-task/setup-task@v1
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: 'package-lock.json'
- name: Setup cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: |
if [ ! -d node_modules ]; then
npm install
fi
- name: exec lint
run: task lint:all
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 15
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
- name: Setup Task
uses: go-task/setup-task@v1
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: 'package-lock.json'
- name: Setup cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: |
if [ ! -d node_modules ]; then
npm install
fi
- name: Cache Electron binaries
uses: actions/cache@v4
with:
path: ${{ env.ELECTRON_CACHE }}
key: ${{ runner.os }}-electron-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-electron-
build:
name: Build Electron App
runs-on: ${{ matrix.os }}
timeout-minutes: 20
needs: [lint]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: win
- os: macos-latest
platform: mac
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
- name: Setup Task
uses: go-task/setup-task@v1
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: 'package-lock.json'
- name: Install dependencies
run: npm install
- name: Cache Electron binaries
uses: actions/cache@v4
with:
path: ${{ env.ELECTRON_CACHE }}
key: ${{ runner.os }}-electron-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-electron-
- name: Setup Linux dependencies
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
- name: Build Electron app (Linux)
if: matrix.platform == 'linux'
run: |
xvfb-run -a npx electron-builder --linux tar.gz --x64 --publish=never --config electron-builder.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Electron app (Windows)
if: matrix.platform == 'win'
run: |
npx electron-builder --win portable --x64 --publish=never --config electron-builder.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Electron app (macOS)
if: matrix.platform == 'mac'
run: |
npx electron-builder --mac dmg --x64 --publish=never --config electron-builder.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: electron-app-${{ matrix.platform }}-${{ github.sha }}
path: dist/
retention-days: 7