Skip to content

Commit 21b4ee1

Browse files
committed
fix: ci test with playwright
1 parent 15f0454 commit 21b4ee1

File tree

3 files changed

+40
-35
lines changed

3 files changed

+40
-35
lines changed

.github/workflows/macos.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,52 @@ on:
1414
# Allows you to run this workflow manually from the Actions tab
1515
workflow_dispatch:
1616

17-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18-
permissions:
19-
contents: read
20-
2117
jobs:
2218
build:
2319
strategy:
2420
matrix:
2521
node-version: [22]
2622

2723
# The type of runner that the job will run on
28-
runs-on: macos-12
24+
runs-on: macos-latest
2925

3026
steps:
3127
- uses: actions/checkout@v6
3228

33-
- name: Cache node modules
29+
- name: Cache Node modules
3430
uses: actions/cache@v4
35-
env:
36-
cache-name: cache-node-modules
3731
with:
38-
# npm cache files are stored in `~/.npm` on Linux/macOS
32+
# npm cache files are stored in ~/.npm
3933
path: ~/.npm
40-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
4135
restore-keys: |
42-
${{ runner.os }}-build-${{ env.cache-name }}-
43-
${{ runner.os }}-build-
44-
${{ runner.os }}-
36+
${{ runner.os }}-node-
4537
4638
- name: Use Node.js ${{ matrix.node-version }}
4739
uses: actions/setup-node@v6
4840
with:
4941
node-version: ${{ matrix.node-version }}
5042

43+
- name: Install macOS dependencies
44+
if: matrix.platform == 'macos-latest'
45+
run: |
46+
brew install gnu-tar coreutils
47+
echo "Homebrew dependencies installed"
48+
5149
- name: Install Dependencies
52-
run: npm i && npm i -D cli-truncate iconv-corefoundation
50+
run: npm ci && npm i -D cli-truncate iconv-corefoundation
5351

5452
- name: Check lint
5553
run: npm run lint
5654

55+
- name: Install Playwright Browsers
56+
run: npx playwright@1.57.0 install --with-deps
57+
58+
- name: Run headless unit test
59+
run: npm run test -- --reporters=default
60+
61+
- name: Run headless e2e test
62+
run: npm run e2e
63+
5764
- name: Build the app
5865
run: npm run electron:build

.github/workflows/ubuntu.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v6
2929

30-
- name: Cache node modules
30+
- name: Cache Node modules
3131
uses: actions/cache@v4
32-
env:
33-
cache-name: cache-node-modules
3432
with:
35-
# npm cache files are stored in `~/.npm` on Linux/macOS
33+
# npm cache files are stored in ~/.npm
3634
path: ~/.npm
37-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
35+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
3836
restore-keys: |
39-
${{ runner.os }}-build-${{ env.cache-name }}-
40-
${{ runner.os }}-build-
41-
${{ runner.os }}-
37+
${{ runner.os }}-node-
4238
4339
- name: Use Node.js ${{ matrix.node-version }}
4440
uses: actions/setup-node@v6
@@ -51,15 +47,18 @@ jobs:
5147
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
5248
5349
- name: Install Dependencies
54-
run: npm i
50+
run: npm ci
5551

5652
- name: Check lint
5753
run: npm run lint
5854

55+
- name: Install Playwright Browsers
56+
run: npx playwright@1.57.0 install --with-deps
57+
5958
- name: Run headless unit test
6059
uses: GabrielBB/xvfb-action@v1
6160
with:
62-
run: npm run test
61+
run: npm run test -- --reporters=default
6362

6463
- name: Run headless e2e test
6564
uses: GabrielBB/xvfb-action@v1

.github/workflows/windows.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,36 @@ jobs:
2525
node-version: [22]
2626

2727
# The type of runner that the job will run on
28-
runs-on: windows-2022
28+
runs-on: windows-latest
2929

3030
steps:
3131
- uses: actions/checkout@v6
3232

33-
- name: Cache node modules
33+
- name: Cache Node modules
3434
uses: actions/cache@v4
35-
env:
36-
cache-name: cache-node-modules
3735
with:
38-
# npm cache files are stored in `~/.npm`
36+
# npm cache files are stored in ~/.npm
3937
path: ~/.npm
40-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
38+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
4139
restore-keys: |
42-
${{ runner.os }}-build-${{ env.cache-name }}-
43-
${{ runner.os }}-build-
44-
${{ runner.os }}-
40+
${{ runner.os }}-node-
4541
4642
- name: Use Node.js ${{ matrix.node-version }}
4743
uses: actions/setup-node@v6
4844
with:
4945
node-version: ${{ matrix.node-version }}
5046

5147
- name: Install Dependencies
52-
run: npm i
48+
run: npm ci
5349

5450
- name: Check lint
5551
run: npm run lint
5652

53+
- name: Install Playwright Browsers
54+
run: npx playwright@1.57.0 install --with-deps
55+
5756
- name: Run headless unit test
58-
run: npm run test
57+
run: npm run test -- --reporters=default
5958

6059
- name: Run headless e2e test
6160
run: npm run e2e

0 commit comments

Comments
 (0)