-
Notifications
You must be signed in to change notification settings - Fork 20
99 lines (84 loc) · 2.49 KB
/
electron-test.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
name: E2E Testing
on:
push:
paths-ignore:
- "docs/**"
branches:
- main
pull_request:
paths-ignore:
- "docs/**"
types:
- opened
- reopened
- synchronize
- ready_for_review
# When pushing new commits, cancel any running builds on that branch
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
CI: "true"
NODE_ENV: "dev"
DISPLAY: :0
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
electron_app:
if: ${{ (!github.event.pull_request.draft && github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
strategy:
matrix:
os: [macos-latest-xlarge, windows-latest, "ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Cache 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: Install Node Dependencies
run: pnpm install
- name: Build executable
if: ${{ matrix.os == 'macos-latest-xlarge' }}
run: pnpm run electron-package:mac
- name: Build executable
if: ${{ matrix.os == 'windows-latest' }}
run: pnpm run electron-package:windows
- name: Build executable
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm run electron-package:linux
- name: Set up Xvfb (Linux only)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y xvfb
Xvfb -screen 0 1024x768x24 :0 &
sleep 5
- name: Run Test
run: pnpm run e2e
- name: Upload outputs
if: always()
uses: actions/upload-artifact@v3
with:
name: test-${{ matrix.os }}-output
path: test-results