Skip to content

Commit

Permalink
fix: moved coveralls into build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfisher committed Oct 24, 2020
1 parent b421bea commit a747d6e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 49 deletions.
52 changes: 43 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Build process
on: [push, pull_request]
name: Build, test and coverage
on: push

jobs:
test:
name: Build and test
runs-on: ubuntu-latest
test-matrix:
strategy:
matrix:
node: [8, 10, 12]
node: [8, 10, 12, 14]
name: Test build Node v ${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -18,17 +18,51 @@ jobs:
node-version: ${{ matrix.node }}

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v1
with:
path: node_modules
key: build-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: build-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
path: ./node_modules
key: test-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: test-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}

- name: Install deps
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install

- name: Lint code
run: make lint

- name: Run tests
run: make tests

test-success:
runs-on: ubuntu-latest
needs: test-matrix
steps:
- name: Matrix tests passed
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 }}

40 changes: 0 additions & 40 deletions .github/workflows/coverage.yml

This file was deleted.

0 comments on commit a747d6e

Please sign in to comment.