Skip to content

update github codecov action #75

update github codecov action

update github codecov action #75

Workflow file for this run

name: unit-tests
on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [16, 18, 20, 21]
name: ${{ matrix.os }} Node ${{ matrix.node }} cache
env:
OS: ${{ matrix.os }}
NODE: ${{ matrix.node }}
steps:
- if: ${{ matrix.os == 'ubuntu-latest' || matrix.node == 20 }}
uses: actions/checkout@v4
- if: ${{ matrix.os == 'ubuntu-latest' || matrix.node == 20 }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- if: ${{ matrix.os != 'windows-latest' && ( matrix.os == 'ubuntu-latest' || matrix.node == 20 ) }}
name: Get npm cache directory
id: npm-cache
run: |
echo "CACHE_DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
# getting and storing cache takes about 1:20 min each on windows
- if: ${{ matrix.os != 'windows-latest' && ( matrix.os == 'ubuntu-latest' || matrix.node == 20 ) }}
uses: actions/cache@v4
id: cache
with:
path: ${{ steps.npm-cache.outputs.CACHE_DIR }}
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-
${{ runner.os }}-node-
- if: ${{ matrix.os == 'ubuntu-latest' || matrix.node == 20 }}
run: npm ci
- if: ${{ matrix.os == 'ubuntu-latest' || matrix.node == 20 }}
run: npm run test:after-commit
- if: ${{ matrix.os == 'ubuntu-latest' || matrix.node == 20 }}
uses: codecov/codecov-action@v4
with:
flags: unittests
env_vars: OS,NODE
verbose: true