Skip to content

Merge pull request #9 from kjanat/dependabot/github_actions/dot-githu… #12

Merge pull request #9 from kjanat/dependabot/github_actions/dot-githu…

Merge pull request #9 from kjanat/dependabot/github_actions/dot-githu… #12

Workflow file for this run

name: Test with jest
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ created ]
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # Runs every day at midnight
jobs:
test:
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node: ['18.x', '20.x', 'latest']
steps:
- uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# 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: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci --include=dev
- name: Run unit tests
run: npm run test:unit
- name: Run integration tests
run: npm run test:integration
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
if: success() && github.event_name == 'release'
with:
name: codecov-umbrella
fail_ci_if_error: true
directory: ./coverage
files: ./unit/clover.xml,./integration/clover.xml
flags: unittests
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}