Skip to content

Merge pull request #819 from infinum/feature/main-branch-sync #892

Merge pull request #819 from infinum/feature/main-branch-sync

Merge pull request #819 from infinum/feature/main-branch-sync #892

Workflow file for this run

name: Tests
on:
# Run on PRs and pushes, only on significant changes.
push:
branches:
- develop
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Jest - Unit tests on Node ${{ matrix.node }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
node: [ '18' ]
allowed_failure: [ false ]
include:
# Test against latest Node version, but allow it to fail.
# We need success only on LTS versions.
- node: '20'
allowed_failure: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install node packages
run: npm install
- name: Install node packages in setup
working-directory: ./setup/create-wp-project
run: npm install
- name: Run coverage generation
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/clover.xml
flags: unittests
name: frontend-libs-codecov
fail_ci_if_error: true