Migrate to GitHub Actions

GH Actions now also do a production build with all supported Node versions to catch any Webpack errors

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-11-11 10:03:08 +01:00
parent e28bc8eab4
commit 4ba4bad7de
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 82 additions and 41 deletions

82
.github/workflows/node.js.yml vendored Normal file
View file

@ -0,0 +1,82 @@
name: Node.js CI
on: [push, pull_request]
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
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile --prefer-offline
- run: ${{matrix.command}}
dynamic-tests:
needs: static-tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile --prefer-offline
- run: yarn run mocha-suite
production-build:
needs: dynamic-tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --frozen-lockfile --prefer-offline
- run: yarn run build

View file

@ -1,41 +0,0 @@
language: node_js
dist: xenial
cache: yarn
jobs:
include:
- stage: Static Tests
name: eslint
node_js:
- 10
script:
- yarn run eslint
- name: markdownlint
node_js:
- 10
script:
- yarn run markdownlint
- name: ShellCheck
script:
- shellcheck bin/heroku bin/setup
language: generic
- name: json-lint
node_js:
- 10
addons:
apt:
packages:
- jq
script:
- yarn run jsonlint
- stage: Dynamic Tests
name: Node.js 10
node_js:
- 10
script:
- yarn run mocha-suite
- name: Node.js 12
node_js:
- 12
script:
- yarn run mocha-suite