-
-
Notifications
You must be signed in to change notification settings - Fork 58
100 lines (95 loc) · 2.53 KB
/
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
name: 'Build & Test'
on:
push:
branches:
- master
- release/**
pull_request:
env:
ELECTRON_CACHE_DIR: ${{ github.workspace }}
FAILURE_LOG: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Install
run: yarn install
- name: Build
run: yarn build
- name: Pack
run: yarn pack
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: |
${{ github.workspace }}/*.tgz
- id: set-matrix
run: echo "matrix=$(node ./scripts/e2e-test-versions.js)" >> "$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: yarn install
- name: Run Linter
run: yarn lint
test:
name: Unit Tests
needs: build
runs-on: ${{ matrix.os }}
strategy:
# we want that the matrix keeps running, default is to cancel all if one fails.
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: yarn install
- name: Run Unit Tests
timeout-minutes: 10
run: yarn test
e2e:
name: E2E Tests
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
electron: ${{ fromJson(needs.build.outputs.matrix) }}
env:
ELECTRON_VERSION: ${{ matrix.electron }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: yarn install
- name: Run E2E Tests
timeout-minutes: 30
run: yarn e2e
required_jobs_passed:
name: All required jobs passed or were skipped
needs: [build, lint, test, e2e]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
steps:
- name: Check for failures
if: contains(needs.*.result, 'failure')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1