Skip to content

Commit 8dc7c7d

Browse files
authored
chore: Fix nyc error and enable node_modules caching
1 parent 06965a5 commit 8dc7c7d

File tree

4 files changed

+9433
-13
lines changed

4 files changed

+9433
-13
lines changed

Diff for: .github/workflows/main.yml

+39-9
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,58 @@ jobs:
1313
- 14
1414
- 12
1515
- 10
16+
1617
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v1
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Setup Node
22+
uses: actions/setup-node@v1
1923
with:
2024
node-version: ${{ matrix.node-version }}
21-
- run: npm install
22-
- run: npm run build
23-
- run: npm run lint
24-
- run: nyc --silent npm run test
25-
- run: nyc report --reporter=text-lcov | coveralls
26-
- run: nyc check-coverage --lines 90
25+
26+
- name: Cache node modules
27+
id: cache-node-modules
28+
uses: actions/cache@v2
29+
env:
30+
cache-name: cache-node-modules
31+
with:
32+
path: node_modules
33+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
34+
restore-keys: |
35+
${{ runner.os }}-build-${{ env.cache-name }}-
36+
${{ runner.os }}-build-
37+
${{ runner.os }}-
38+
39+
- name: Install Dependencies
40+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
41+
run: npm ci
42+
43+
- name: Build
44+
run: npm run build
45+
46+
- name: Lint
47+
run: npm run lint
48+
49+
- name: Test & Report
50+
run: npm run nyc
51+
52+
- name: Upload to Coveralls
53+
uses: coverallsapp/github-action@master
54+
with:
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
2756
release:
2857
name: Release
2958
needs: test
3059
if: github.ref == 'refs/heads/master'
3160
runs-on: ubuntu-latest
61+
3262
steps:
3363
- uses: actions/checkout@v2
3464
- uses: actions/setup-node@v1
3565
with:
3666
node-version: 10
37-
- run: npm install
67+
- run: npm ci
3868
- run: npm run build
3969
- run: npx semantic-release
4070
env:

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
package-lock.json
32
coverage
43
dist
54
src/generated

0 commit comments

Comments
 (0)