Skip to content

Commit

Permalink
fix: updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chvarkov committed Sep 7, 2024
1 parent 54db8dc commit f3f0643
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
name: Test
on: [push, pull_request, workflow_dispatch]

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

jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install
run: npm install
- name: Test and Coverage
run: npm run test:cov
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: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test --coverage
- name: Update Coverage Badge
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && matrix.node-version == '22.x'}}
uses: we-cli/coverage-badge-action@main

0 comments on commit f3f0643

Please sign in to comment.