Skip to content

Commit

Permalink
feat: try review approved
Browse files Browse the repository at this point in the history
  • Loading branch information
sravan-s committed Mar 31, 2023
1 parent c3ffd6e commit d7341bd
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 34 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Caching with npm
on: push
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
node-version: ${{ matrix.node-version }}
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list

- name: Install dependencies
run: npm install

- name: Lint
run: npm run lint

- name: Test
run: npm run test
30 changes: 0 additions & 30 deletions .github/workflows/test-n-lint.yml

This file was deleted.

16 changes: 13 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Caching with npm
name: Test and coverage
on: push
# on:
# pull_request_review:
# types: [submitted]
jobs:
build:
test:
# if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -32,4 +36,10 @@ jobs:
run: npm install

- name: Test
run: npm test
run: npm run coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage/*.json
fail_ci_if_error: true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"node": "16.x"
},
"scripts": {
"test": "jest --coverage",
"test": "jest",
"coverage": "jest --coverage",
"test-update-snapshot": "jest -u",
"afterbuild": "node ./scripts/post_build.js;",
"cp-css": "./scripts/copy-css.sh",
Expand Down

0 comments on commit d7341bd

Please sign in to comment.