Add alternative to README #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [8.3.0, 10.x, 12.x, 14.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# However Node 8.3.0 comes with npm 5.3.0. | |
# npm 5.7.1 is the first version to support npm ci | |
- if: ${{ matrix.node-version == '8.3.0' }} | |
run: npm install -g [email protected] | |
- run: npm ci | |
- run: npm run build --if-present | |
# ESLint uses newer JS not in Node 8.3.0 | |
- if: ${{ matrix.node-version != '8.3.0' }} | |
run: npm run lint | |
- run: npm test | |
# Master doesn't have a PR for comments so skip that branch | |
# We don't want 4 comments about code coverage, just just run it once on 8.3.0 | |
- if: ${{ github.ref != 'refs/heads/master' && matrix.node-version == '8.3.0' }} | |
uses: romeovs/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
lcov-file: ./tests/coverage/lcov.info |