Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung <lionkay@gmail.com>
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: Dev
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- patch-release
|
|
- next
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
timeout-minutes: 15
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- "ubuntu-latest"
|
|
- "macos-latest"
|
|
- "windows-latest"
|
|
node:
|
|
# Latest even version
|
|
- "24"
|
|
# Minimal version for development
|
|
- "20"
|
|
include:
|
|
- os: "ubuntu-latest"
|
|
# Pick a version that is fast (normally highest LTS version)
|
|
node: "24"
|
|
ENABLE_CODE_COVERAGE: true
|
|
FULL_TEST: true
|
|
CHECK_TEST_PARSERS: true
|
|
# Versions not tested on linux, normally only even versions
|
|
# If latest version is an odd number, it can be listed below too
|
|
- os: "ubuntu-latest"
|
|
node: "22"
|
|
env:
|
|
ENABLE_CODE_COVERAGE: ${{ matrix.ENABLE_CODE_COVERAGE }}
|
|
FULL_TEST: ${{ matrix.FULL_TEST }}
|
|
CHECK_TEST_PARSERS: ${{ matrix.CHECK_TEST_PARSERS }}
|
|
name: ${{ matrix.FULL_TEST && '[Full Test] ' || '' }} Node.js ${{ matrix.node }} on ${{ startsWith(matrix.os, 'macos') && 'MacOS' || startsWith(matrix.os, 'windows') && 'Windows' || 'Linux' }}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: "yarn"
|
|
|
|
- name: Install Dependencies
|
|
run: yarn install --immutable
|
|
|
|
- name: Run Tests
|
|
if: ${{ !matrix.ENABLE_CODE_COVERAGE }}
|
|
run: yarn test
|
|
|
|
- name: Run Tests (coverage)
|
|
if: ${{ matrix.ENABLE_CODE_COVERAGE }}
|
|
run: yarn c8 yarn test
|
|
|
|
- name: Upload Coverage
|
|
uses: codecov/codecov-action@v5
|
|
if: ${{ matrix.ENABLE_CODE_COVERAGE }}
|
|
with:
|
|
fail_ci_if_error: true
|
|
disable_search: true
|
|
files: coverage/lcov.info
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|