2020-11-11 04:03:08 -05:00
|
|
|
name: Node.js CI
|
|
|
|
|
2020-11-26 15:21:12 -05:00
|
|
|
on:
|
|
|
|
push:
|
2021-08-14 08:36:08 -04:00
|
|
|
branches: [master]
|
2020-11-26 15:21:12 -05:00
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
2020-11-11 04:03:08 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
static-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
command:
|
|
|
|
- yarn run eslint
|
|
|
|
- yarn run markdownlint
|
|
|
|
- shellcheck bin/heroku bin/setup
|
|
|
|
- sudo apt install -y jq && yarn run jsonlint
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-08-14 10:52:29 -04:00
|
|
|
- name: Use Node.js 16
|
2021-02-05 15:59:08 -05:00
|
|
|
uses: actions/setup-node@v2
|
2020-11-11 04:03:08 -05:00
|
|
|
with:
|
2021-08-14 10:52:29 -04:00
|
|
|
node-version: 16
|
2021-08-14 10:51:35 -04:00
|
|
|
cache: yarn
|
2020-11-11 04:03:08 -05:00
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: ${{matrix.command}}
|
|
|
|
dynamic-tests:
|
|
|
|
needs: static-tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-08-14 10:53:39 -04:00
|
|
|
node-version: [12, 14, 16]
|
2020-11-11 04:03:08 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2021-02-05 15:59:08 -05:00
|
|
|
uses: actions/setup-node@v2
|
2020-11-11 04:03:08 -05:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-08-14 10:51:35 -04:00
|
|
|
cache: yarn
|
2020-11-11 04:03:08 -05:00
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: yarn run mocha-suite
|
|
|
|
production-build:
|
|
|
|
needs: dynamic-tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-08-14 10:53:39 -04:00
|
|
|
node-version: [12, 14, 16]
|
2020-11-11 04:03:08 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2021-02-05 15:59:08 -05:00
|
|
|
uses: actions/setup-node@v2
|
2020-11-11 04:03:08 -05:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-08-14 10:51:35 -04:00
|
|
|
cache: yarn
|
2020-11-11 04:03:08 -05:00
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: yarn run build
|
2020-11-17 18:12:25 -05:00
|
|
|
- uses: actions/upload-artifact@v2
|
2021-08-14 10:53:39 -04:00
|
|
|
if: github.ref == 'refs/heads/master' && matrix.node-version == '16'
|
2020-11-17 18:12:25 -05:00
|
|
|
with:
|
|
|
|
name: Prebuild with Node.js ${{ matrix.node-version }}
|
|
|
|
path: |
|
|
|
|
**
|
|
|
|
!.git
|
|
|
|
!node_modules
|