improve CI builds #493
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI pipeline | |
on: [ push, pull_request, workflow_dispatch ] | |
permissions: read-all | |
jobs: | |
build: | |
name: "Build ${{ matrix.os }} node${{ matrix.node-version }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
node-version: [ 10.x, 12.x, 14.x, 16.x ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# 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 | |
shell: sh | |
run: | | |
npm ci --loglevel verbose | |
- name: Build the app | |
shell: sh | |
run: | | |
npm run build --if-present --loglevel verbose | |
- if: matrix.node-version != '10.x' | |
name: Run compress tests | |
shell: sh | |
run: | | |
npm run test:compress --loglevel verbose | |
- if: matrix.node-version != '10.x' | |
name: Run mocha tests | |
shell: sh | |
run: | | |
npm run test:mocha --loglevel verbose | |
env: | |
TERSER_TEST_ALL: 1 | |
- if: matrix.node-version == '10.x' | |
name: Run all tests with Node 10.x | |
shell: sh | |
run: | | |
node --require esm test/compress.js --loglevel verbose | |
npm run test:mocha -- --require esm --loglevel verbose | |
- if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12.x' | |
name: Run functional tests on ${{ matrix.os }} with Node 12.x | |
run: | | |
./test/functional.sh | |