2020-11-11 09:03:08 +00:00
|
|
|
name: Node.js CI
|
|
|
|
|
2020-11-26 20:21:12 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-08-14 12:36:08 +00:00
|
|
|
branches: [master]
|
2020-11-26 20:21:12 +00:00
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
2020-11-11 09:03:08 +00: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 08:28:27 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-14 14:52:29 +00:00
|
|
|
- name: Use Node.js 16
|
2022-03-05 08:28:31 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-11-11 09:03:08 +00:00
|
|
|
with:
|
2021-08-14 14:52:29 +00:00
|
|
|
node-version: 16
|
2021-08-14 14:51:35 +00:00
|
|
|
cache: yarn
|
2020-11-11 09:03:08 +00:00
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: ${{matrix.command}}
|
|
|
|
dynamic-tests:
|
|
|
|
needs: static-tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-05-01 18:45:43 +00:00
|
|
|
node-version: [14, 16]
|
2020-11-11 09:03:08 +00:00
|
|
|
steps:
|
2022-03-05 08:28:27 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-11 09:03:08 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-03-05 08:28:31 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-11-11 09:03:08 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-08-14 14:51:35 +00:00
|
|
|
cache: yarn
|
2020-11-11 09:03:08 +00: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 18:45:43 +00:00
|
|
|
node-version: [14, 16]
|
2020-11-11 09:03:08 +00:00
|
|
|
steps:
|
2022-03-05 08:28:27 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-11 09:03:08 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-03-05 08:28:31 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-11-11 09:03:08 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-08-14 14:51:35 +00:00
|
|
|
cache: yarn
|
2020-11-11 09:03:08 +00:00
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: yarn run build
|
2022-03-05 08:28:34 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2021-08-14 14:53:39 +00:00
|
|
|
if: github.ref == 'refs/heads/master' && matrix.node-version == '16'
|
2020-11-17 23:12:25 +00:00
|
|
|
with:
|
|
|
|
name: Prebuild with Node.js ${{ matrix.node-version }}
|
|
|
|
path: |
|
|
|
|
**
|
|
|
|
!.git
|
|
|
|
!node_modules
|