Skip to content

Commit

Permalink
Merge 62e1de8 into 5847799
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfisher committed Oct 5, 2020
2 parents 5847799 + 62e1de8 commit b7ba347
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Library Tests

on: pull_request

jobs:
test-matrix:
strategy:
matrix:
node: [ '12', '14' ]
name: Test Library Node v ${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v1
with:
path: ./node_modules
key: test-${{ matrix.node }}-${{hashFiles('./package-lock.json')}}
restore-keys: test-${{ matrix.node }}-${{hashFiles('./package-lock.json')}}
- name: Install modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
- name: Run tests
run: npm test

test-success:
runs-on: ubuntu-latest
needs: test-matrix
steps:
- name: Tests completed
run: echo Done!

test-coverage:
runs-on: ubuntu-latest
needs: test-success
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/cache@v1
id: cache-node-modules
with:
path: ./node_modules
key: test-12-${{hashFiles('./package-lock.json')}}
restore-keys: test-12-${{hashFiles('./package-lock.json')}}
- name: Install modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
- name: Test with coverage
run: npm run test-cover
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b7ba347

Please sign in to comment.