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:
|
2022-03-05 03:28:27 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-14 10:52:29 -04:00
|
|
|
- name: Use Node.js 16
|
2022-03-05 03:28:31 -05:00
|
|
|
uses: actions/setup-node@v3
|
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:
|
2022-05-01 14:45:43 -04:00
|
|
|
node-version: [14, 16]
|
2020-11-11 04:03:08 -05:00
|
|
|
steps:
|
2022-03-05 03:28:27 -05:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-11 04:03:08 -05:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-03-05 03:28:31 -05:00
|
|
|
uses: actions/setup-node@v3
|
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:
|
2022-05-01 14:45:43 -04:00
|
|
|
node-version: [14, 16]
|
2020-11-11 04:03:08 -05:00
|
|
|
steps:
|
2022-03-05 03:28:27 -05:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-11 04:03:08 -05:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-03-05 03:28:31 -05:00
|
|
|
uses: actions/setup-node@v3
|
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
|
2022-03-05 03:28:34 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
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
|