-
Notifications
You must be signed in to change notification settings - Fork 310
143 lines (123 loc) · 4.44 KB
/
Copy pathunit-test.yml
File metadata and controls
143 lines (123 loc) · 4.44 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Unit Test
on:
pull_request:
branches:
- dev
- release/**
push:
branches:
- dev
- release/**
jobs:
unit-test:
runs-on: ubuntu-latest
env:
CODECOV_FILES: packages/api/coverage/lcov.info,packages/vscode-ui/coverage/lcov.info,packages/fx-core/coverage/lcov.info,packages/manifest/coverage/lcov.info,packages/vscode-extension/coverage/lcov.info,packages/server/coverage/lcov.info,packages/spec-parser/coverage/lcov.info,packages/cli/coverage/lcov.info,packages/cli/coverage/coverage-summary.json
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 "bot@user.noreply.github.com"
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: Check scenario artifacts
run: pnpm --dir packages/fx-core run scenario:check
- name: Unit Test
run: |
xvfb-run -a pnpm -r --stream --workspace-concurrency=8 run test:unit
- name: CodeCov report attempt 1
id: codecov1
continue-on-error: true
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.CODECOV_FILES }}
disable_search: true
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 }}
files: ${{ env.CODECOV_FILES }}
disable_search: true
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 }}
files: ${{ env.CODECOV_FILES }}
disable_search: true
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 }}
files: ${{ env.CODECOV_FILES }}
disable_search: true
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 }}
files: ${{ env.CODECOV_FILES }}
disable_search: true
fail_ci_if_error: true
verbose: true
scenario-tooling-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup project
uses: ./.github/actions/setup-project
- name: Test scenario tooling on Windows
run: pnpm --dir packages/fx-core exec vitest run --config vitest.config.ts tests/scenarioTooling/scenarioCommands.test.ts