Repository navigation
59 lines (50 loc) · 1.81 KB
/
Copy pathcodecov.yaml
File metadata and controls
59 lines (50 loc) · 1.81 KB
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
name: Code Coverage
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unit_tests:
name: Run unit tests to track code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '22'
- name: Enable Corepack
run: corepack enable
- name: Cache node modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Run unit tests with coverage
run: yarn test --ci --maxWorkers=2
- name: Install Codecov CLI
run: |
curl -Os https://cli.codecov.io/latest/linux/codecov
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig
curl https://keybase.io/codecovsecops/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
- name: Upload coverage to Codecov
if: always()
run: |
./codecov upload-process \
--file coverage/lcov.info \
--flag unit-tests \
--slug openshift-pipelines/console-plugin \
--git-service github \
|| echo "::warning::Codecov upload failed (non-fatal)"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}