Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 8c4ac7f

Browse files
author
Michael Perrotte
committedFeb 28, 2020
ci: updated GHA workflow; added supporting script to package.json
1 parent b25d703 commit 8c4ac7f

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
 

‎.github/workflows/ci.yml

+34
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,38 @@ jobs:
5858
# Simply run the tests for the project.
5959
################################################################################
6060
- name: Run tests
61+
if: github.event_name != 'push' || matrix.node-version != '12.x' || matrix.os != 'ubuntu-latest'
62+
run: npm test -- --no-coverage
63+
64+
################################################################################
65+
# Run coverage check
66+
#
67+
# ASSUMPTIONS:
68+
# - The project has `tap` as a devDependency
69+
# - There is a script called "coverage" in the package.json
70+
#
71+
# Coverage should only be posted once, we are choosing the latest LTS of
72+
# node, and ubuntu as the matrix point to post coverage from. We limit
73+
# to the 'push' event so that coverage ins't posted twice from the
74+
# pull-request event, and push event (line 3).
75+
################################################################################
76+
- name: Run coverage report
77+
if: github.event_name == 'push' && matrix.node-version == '12.x' && matrix.os == 'ubuntu-latest'
6178
run: npm test
79+
env:
80+
# The environment variable name is leveraged by `tap`
81+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
82+
83+
################################################################################
84+
# Run linting
85+
#
86+
# ASSUMPTIONS:
87+
# - There is a script called "lint" in the package.json
88+
#
89+
# We run linting AFTER we run testing and coverage checks, because if a step
90+
# fails in an GitHub Action, all other steps are not run. We don't want to
91+
# fail to run tests or coverage because of linting. It should be the lowest
92+
# priority of all the steps.
93+
################################################################################
94+
- name: Run linter
95+
run: npm run lint

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prerelease": "npm t",
1717
"release": "standard-version -s",
1818
"postrelease": "npm publish && git push --follow-tags",
19-
"pretest": "standard",
19+
"lint": "standard",
2020
"test": "tap"
2121
},
2222
"tap": {

0 commit comments

Comments
 (0)
This repository has been archived.