Skip to content

Commit

Permalink
Merge pull request #159 from chvarkov/develop
Browse files Browse the repository at this point in the history
tech: test workflow
  • Loading branch information
chvarkov authored Sep 7, 2024
2 parents 555aecb + 5af0198 commit 4933092
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run test:cov
- name: Update Coverage Badge
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && matrix.node-version == '22.x'}}
uses: we-cli/coverage-badge-action@main
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint:fix": "eslint . --fix",
"lint:check": "eslint . --max-warnings=0",
"test": "jest --silent=false",
"test:cov": "jest --coverage",
"test:cov": "jest --coverage --coverageReporters=\"json-summary\"",
"test:coveralls": "jest --runInBand --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"publish-package": "cd dist && npm publish --access public"
},
Expand Down

0 comments on commit 4933092

Please sign in to comment.