Skip to content

Commit c2053cb

Browse files
authored
ci: enhance our test environment setup (#4291)
* fix: pptr timeout issue * fix: try again * chore: fix pptr timeout issue * fix: test scripts * chore: drop node 10/12/14 * fix: node 23 deprecated api * chore: tru again * fix: windows * fix: windows is * chore: test node14 * fix: drop node v10/v12/v14 support * chore: remove sandbox config * fix: add sandbox config * ci: try playwright * chore: update ci yml * chore: test node * chore: add all test * fix: yml grammer * chore: try topo * chore: node23 test * chore: nodejs v23 * fix: yml grammer * fix: steps's id * chore: final test config * chore: update folder name * chore: refactor * chore: update title * chore: improve code quality
1 parent 9d92b0c commit c2053cb

File tree

6 files changed

+322
-958
lines changed

6 files changed

+322
-958
lines changed

.github/workflows/ci.yml

+49-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Github actions workflow name
2-
name: Nodejs Test
2+
name: CI
33

44
# Triggers the workflow on push or pull request events
55
on:
@@ -9,13 +9,31 @@ on:
99
branches: [main, master]
1010

1111
jobs:
12-
platform_spec_test:
13-
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
12+
basic_node_test:
13+
name: 'Basic tests on ubuntu-latest with nodejs v22 (current LTS version)'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{ matrix.node }}
20+
- name: Install npm dependencies
21+
run: npm install
22+
- name: Print put node & npm version
23+
run: node --version && npm --version
24+
- name: Install chromium
25+
run: npx playwright install chromium
26+
- name: Run unit test
27+
run: npm run test
28+
29+
windows_and_macos_test:
30+
name: 'Platform tests on ${{matrix.os}} with nodejs v${{matrix.node}}'
31+
needs: basic_node_test
1432
strategy:
1533
matrix:
1634
# Test all mainstream operating system
17-
os: [ubuntu-latest, macos-latest, windows-latest]
18-
node: [18]
35+
os: [macos-latest, windows-latest]
36+
node: [22]
1937
runs-on: ${{ matrix.os }}
2038
steps:
2139
# Pull repo to test machine
@@ -30,15 +48,18 @@ jobs:
3048
- name: Print put node & npm version
3149
# Output useful info for debugging.
3250
run: node --version && npm --version
51+
- name: Install chromium
52+
run: npx playwright install chromium
3353
- name: Run unit test
3454
run: npm run test
3555

36-
fast_node_test:
37-
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
56+
historical_versions_node_test:
57+
name: 'Historical version nodejs v${{matrix.node}} test'
58+
needs: basic_node_test
3859
strategy:
3960
matrix:
4061
os: [ubuntu-latest]
41-
node: [10, 12, 14, 16, 20]
62+
node: [14, 16, 18, 20]
4263
runs-on: ${{ matrix.os }}
4364
steps:
4465
- uses: actions/checkout@v2
@@ -49,5 +70,25 @@ jobs:
4970
run: npm install
5071
- name: Print put node & npm version
5172
run: node --version && npm --version
73+
- name: Install chromium
74+
run: npx playwright install chromium
75+
- name: Run unit test
76+
run: npm run test
77+
78+
allow_failure_testing_for_node23:
79+
name: 'Allow failure for nodejs v23 tests'
80+
needs: basic_node_test
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v2
84+
- uses: actions/setup-node@v2
85+
with:
86+
node-version: 23
87+
- name: Install npm dependencies
88+
run: npm install
89+
- name: Print put node & npm version
90+
run: node --version && npm --version
91+
- name: Install chromium
92+
run: npx playwright install chromium
5293
- name: Run unit test
5394
run: npm run test

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)