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
|
name: CI pipeline
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions: read-all
jobs:
build:
name: "Build ${{ matrix.os }} node${{ matrix.node-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: [ 10.x, 12.x, 14.x, 16.x, 20.x ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Tooling setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# Build and test validation
- name: Install dependencies
run: |
npm ci
- name: Build the app
run: |
npm run build --if-present
- if: matrix.node-version != '10.x'
name: Run compress tests
run: |
npm run test:compress
- if: matrix.node-version != '10.x'
name: Run mocha tests
env:
TERSER_TEST_ALL: 1
run: |
npm run test:mocha -- --timeout 80000
# Tests for node 10
- if: matrix.node-version == '10.x'
name: Run compress tests (Node 10.x only)
run: |
node --require esm test/compress.js
- if: matrix.node-version == '10.x'
name: Run mocha tests (Node 10.x only)
run: |
npm run test:mocha -- --require esm --timeout 80000
# Functional tests
- if: matrix.os == 'ubuntu-latest' && matrix.node-version == '16.x'
name: Run functional tests (Ubuntu Node 16.x only)
run: |
./test/functional.sh
# Fuzz tests
- if: matrix.node-version == '20.x'
name: Run fuzz tests (Node 20.x only)
run: |
node ./test/ufuzz.js 1000 --seed 1234
|