summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDavid Mehren2020-11-11 10:03:08 +0100
committerDavid Mehren2020-11-11 20:44:18 +0100
commit4ba4bad7de39dcc9909de2b9940d54f4c08fc7ce (patch)
treea54bcaaa9e1f1ff1ae0a2daa97dc1fddec091e13 /.github
parente28bc8eab4f5b2ed7a59b0297d7c47e5b37afa40 (diff)
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>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/node.js.yml82
1 files changed, 82 insertions, 0 deletions
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml
new file mode 100644
index 00000000..1d7b59d5
--- /dev/null
+++ b/.github/workflows/node.js.yml
@@ -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
+
+