-
Notifications
You must be signed in to change notification settings - Fork 197
116 lines (100 loc) · 3.23 KB
/
unit-test.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Unit Test
on:
pull_request:
branches:
- dev
- release/**
push:
branches:
- dev
- release/**
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout-pr
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
repository: ${{ github.repository }}
- name: Merge Branches
if: ${{ github.event_name == 'pull_request' }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "bot"
git remote add ${{ github.event.pull_request.base.repo.owner.login }} ${{ github.event.pull_request.base.repo.clone_url }}
git fetch ${{ github.event.pull_request.base.repo.owner.login }}
git merge ${{ github.event.pull_request.base.repo.owner.login }}/${{ github.event.pull_request.base.ref }}
- name: setup project
uses: ./.github/actions/setup-project
- name: Unit Test
run: |
xvfb-run -a pnpm run -r --stream test:unit
- name: CodeCov report attempt 1
id: codecov1
continue-on-error: true
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: delay 10s for attempt 2
if: steps.codecov1.outcome == 'failure'
run: |
sleep 10s
- name: CodeCov report attempt 2
id: codecov2
if: steps.codecov1.outcome == 'failure'
continue-on-error: true
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: delay 10s for attempt 3
if: steps.codecov2.outcome == 'failure'
run: |
sleep 10s
- name: CodeCov report attempt 3
id: codecov3
if: steps.codecov2.outcome == 'failure'
continue-on-error: true
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: delay 10s for attempt 4
if: steps.codecov3.outcome == 'failure'
run: |
sleep 10s
- name: CodeCov report attempt 4
id: codecov4
if: steps.codecov3.outcome == 'failure'
continue-on-error: true
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
- name: delay 10s for attempt 5
if: steps.codecov4.outcome == 'failure'
run: |
sleep 10s
- name: CodeCov report attempt 5
id: codecov5
if: steps.codecov4.outcome == 'failure'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true