Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyng committed Jan 23, 2024
1 parent ae3dbbe commit 4cd9986
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: publish

on:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- run: npm ci
- run: |
npm version ${GITHUB_REF_NAME#v}
npm publish
with:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test

on:
pull_request:

jobs:
test:
strategy:
matrix:
node-version: ['16', '18', '20']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npm test -- --coverage --coverageDirectory=coverage/results-${{ matrix.node-version }}
- uses: actions/upload-artifact@v3
with:
name: jest-results-${{ matrix.node-version }}
path: coverage/results-${{ matrix.node-version }}/*.xml
if: ${{ always() }}

0 comments on commit 4cd9986

Please sign in to comment.