Skip to content

Commit

Permalink
ci: enhance our test environment setup (#4291)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
iChenLei authored Jan 7, 2025
1 parent 9d92b0c commit c2053cb
Show file tree
Hide file tree
Showing 6 changed files with 322 additions and 958 deletions.
57 changes: 49 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Github actions workflow name
name: Nodejs Test
name: CI

# Triggers the workflow on push or pull request events
on:
Expand All @@ -9,13 +9,31 @@ on:
branches: [main, master]

jobs:
platform_spec_test:
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
basic_node_test:
name: 'Basic tests on ubuntu-latest with nodejs v22 (current LTS version)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

windows_and_macos_test:
name: 'Platform tests on ${{matrix.os}} with nodejs v${{matrix.node}}'
needs: basic_node_test
strategy:
matrix:
# Test all mainstream operating system
os: [ubuntu-latest, macos-latest, windows-latest]
node: [18]
os: [macos-latest, windows-latest]
node: [22]
runs-on: ${{ matrix.os }}
steps:
# Pull repo to test machine
Expand All @@ -30,15 +48,18 @@ jobs:
- name: Print put node & npm version
# Output useful info for debugging.
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

fast_node_test:
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
historical_versions_node_test:
name: 'Historical version nodejs v${{matrix.node}} test'
needs: basic_node_test
strategy:
matrix:
os: [ubuntu-latest]
node: [10, 12, 14, 16, 20]
node: [14, 16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -49,5 +70,25 @@ jobs:
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test

allow_failure_testing_for_node23:
name: 'Allow failure for nodejs v23 tests'
needs: basic_node_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 23
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Install chromium
run: npx playwright install chromium
- name: Run unit test
run: npm run test
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c2053cb

Please sign in to comment.