2020-05-26 04:03:49 +00:00
|
|
|
# Based on https://github.com/actions/starter-workflows/blob/master/ci/node.js.yml
|
|
|
|
|
|
|
|
name: Build and Test
|
|
|
|
|
2020-05-30 01:16:48 +00:00
|
|
|
on: [push, pull_request]
|
2020-05-26 04:03:49 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: ${{ matrix.operating-system }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
operating-system: [ubuntu-latest, macos-latest, windows-latest]
|
2022-04-26 03:09:26 +00:00
|
|
|
node-version: [12.x, 14.x, 16.x, 17.x, 18.x]
|
2020-05-26 04:03:49 +00:00
|
|
|
|
|
|
|
steps:
|
2022-04-03 03:00:56 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-05-26 04:03:49 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-04-03 03:00:56 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-05-26 04:03:49 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-04-03 03:00:56 +00:00
|
|
|
cache: 'npm'
|
2020-05-26 04:03:49 +00:00
|
|
|
|
|
|
|
- run: npm ci
|
2021-09-15 04:39:11 +00:00
|
|
|
|
2021-09-19 21:15:00 +00:00
|
|
|
# Ensure that we can still build in the current version of Node
|
2020-05-26 04:03:49 +00:00
|
|
|
- run: node ./bin/cake build:except-parser
|
|
|
|
- run: node ./bin/cake build:parser
|
2021-09-19 21:15:00 +00:00
|
|
|
# Build twice to ensure that the latest build of the compiler can still build itself
|
|
|
|
- run: node ./bin/cake build:except-parser
|
|
|
|
- run: node ./bin/cake build:parser
|
|
|
|
# Build the browser compiler for the headless browser test
|
2020-05-26 04:03:49 +00:00
|
|
|
- run: node ./bin/cake build:browser
|
2022-01-25 14:40:48 +00:00
|
|
|
# Build test.html, so that test:browser uses the latest tests
|
|
|
|
- run: node ./bin/cake doc:test
|
2021-09-16 22:04:51 +00:00
|
|
|
|
2021-09-19 21:15:00 +00:00
|
|
|
# Check that the git diff is clean, to ensure that the updated build output was committed
|
2021-09-16 22:04:51 +00:00
|
|
|
- run: git diff --exit-code
|
2021-09-19 21:15:00 +00:00
|
|
|
|
|
|
|
# Test
|
|
|
|
- run: node ./bin/cake test
|
2022-04-26 03:09:26 +00:00
|
|
|
- run: node ./bin/cake test:browser || node ./bin/cake test:browser || node ./bin/cake test:browser
|
2021-09-19 21:15:00 +00:00
|
|
|
- run: node ./bin/cake test:browser:node
|
|
|
|
- run: node ./bin/cake test:integrations
|