-
Notifications
You must be signed in to change notification settings - Fork 12
62 lines (53 loc) · 1.54 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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