Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Move testing and coveralls to github actions #178

Merged
merged 6 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 }}
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.