Skip to content

Commit

Permalink
chore(ci): add vitest coverage action (#556)
Browse files Browse the repository at this point in the history
* Let Volta manage Node setup
  • Loading branch information
ayushmanchhabra committed Jun 27, 2024
1 parent eb41e0c commit 7abbf4b
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 34 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/[email protected]
with:
node-version: 20

- run: npm ci
- run: npm run build
- uses: JS-DevTools/[email protected]
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Volta
uses: volta-cli/[email protected]
- name: Install dependencies
run: npm ci
- name: Build output
run: npm run build
- name: Publish to npm
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.NPM_TOKEN }}
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ on:
- main

jobs:
build:
test:
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/[email protected]
with:
node-version: 20

- run: npm ci
- run: npm run lint
- run: npm run test
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Volta
uses: volta-cli/[email protected]
- name: Install dependencies
run: npm ci
- name: Lint codebase
run: npm run lint
- name: Test codebase
run: npm run test
- name: Report coverage
if: always()
uses: davelosert/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
node_modules

# application
coverage
dist
test/demo/index.js
Loading

0 comments on commit 7abbf4b

Please sign in to comment.