-
Notifications
You must be signed in to change notification settings - Fork 12
190 lines (159 loc) · 6.06 KB
/
test-sdk.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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Test SDK
on:
push:
branches:
- master
workflow_dispatch:
env:
UNIT_TEST_REPORT_PYTHON_3_8: unit-test-report-python3_8.xml
UNIT_TEST_REPORT_PYTHON_3_9: unit-test-report-python3_9.xml
UNIT_TEST_REPORT_PYTHON_3_10: unit-test-report-python3_10.xml
UNIT_TEST_REPORT_PYTHON_3_11: unit-test-report-python3_11.xml
INTEGRATION_TEST_REPORT_PYTHON_3_11: integration-test-report-python3_11.xml
INTEGRATION_TESTS_PRIVATE_KEY: ${{ secrets.SDK_TESTS_PRIVATE_KEY }}
BACKEND_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BACKEND_REPO: cord-team/cord-backend
concurrency:
group: cord-client-${{ github.ref }}-test
cancel-in-progress: true
jobs:
unit-tests-python-3-8:
name: Run unit tests for Python 3.8
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Run unit tests for Python 3.8
uses: ./.github/actions/run-unit-tests
with:
python-version: 3.8.16
test-report-file: ${{ env.UNIT_TEST_REPORT_PYTHON_3_8 }}
unit-tests-python-3-9:
name: Run unit tests for Python 3.9
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Run unit tests for Python 3.9
uses: ./.github/actions/run-unit-tests
with:
python-version: 3.9.10
test-report-file: ${{ env.UNIT_TEST_REPORT_PYTHON_3_9 }}
unit-tests-python-3-10:
name: Run unit tests for Python 3.10
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Run unit tests for Python 3.10
uses: ./.github/actions/run-unit-tests
with:
python-version: 3.10.2
test-report-file: ${{ env.UNIT_TEST_REPORT_PYTHON_3_10 }}
unit-tests-python-3-11:
name: Run unit tests for Python 3.11
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Run unit tests for Python 3.11
uses: ./.github/actions/run-unit-tests
with:
python-version: 3.11.2
test-report-file: ${{ env.UNIT_TEST_REPORT_PYTHON_3_11 }}
integration-tests-python-3-11:
name: Run integration tests for Python 3.11
runs-on: ubuntu-20.04
steps:
- name: Checkout backend repo
uses: actions/checkout@v3
with:
repository: ${{ env.BACKEND_REPO }}
token: ${{ env.BACKEND_ACCESS_TOKEN }}
- name: Run integration tests for Python 3.11
uses: ./.github/actions/run-sdk-integration-tests
with:
python-version: 3.11.2
test-report-file: ${{ env.INTEGRATION_TEST_REPORT_PYTHON_3_11 }}
private-key: ${{ env.INTEGRATION_TESTS_PRIVATE_KEY }}
sdk-repository-url: https://github.com/encord-team/encord-client-python@${{ github.sha }}
publish-test-reports:
name: Publish test reports
runs-on: ubuntu-20.04
needs: [
unit-tests-python-3-8,
unit-tests-python-3-9,
unit-tests-python-3-10,
unit-tests-python-3-11,
integration-tests-python-3-11,
]
if: success() || failure()
steps:
- name: Download unit test report Python 3.8
uses: actions/download-artifact@v2
with:
name: ${{ env.UNIT_TEST_REPORT_PYTHON_3_8 }}
path: ${{ env.UNIT_TEST_REPORT_PYTHON_3_8 }}
- name: Download unit test report Python 3.9
uses: actions/download-artifact@v2
with:
name: ${{ env.UNIT_TEST_REPORT_PYTHON_3_9 }}
path: ${{ env.UNIT_TEST_REPORT_PYTHON_3_9 }}
- name: Download unit test report Python 3.10
uses: actions/download-artifact@v2
with:
name: ${{ env.UNIT_TEST_REPORT_PYTHON_3_10 }}
path: ${{ env.UNIT_TEST_REPORT_PYTHON_3_10 }}
- name: Download unit test report Python 3.11
uses: actions/download-artifact@v2
with:
name: ${{ env.UNIT_TEST_REPORT_PYTHON_3_11 }}
path: ${{ env.UNIT_TEST_REPORT_PYTHON_3_11 }}
- name: Download integration test report Python 3.11
uses: actions/download-artifact@v2
with:
name: ${{ env.INTEGRATION_TEST_REPORT_PYTHON_3_11 }}
path: ${{ env.INTEGRATION_TEST_REPORT_PYTHON_3_11 }}
- name: Publish unit test report Python 3.8
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ env.UNIT_TEST_REPORT_PYTHON_3_8 }}/*.xml
check_name: Unit test report
- name: Publish unit test report Python 3.9
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ env.UNIT_TEST_REPORT_PYTHON_3_9 }}/*.xml
check_name: Unit test report
- name: Publish unit test report Python 3.10
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ env.UNIT_TEST_REPORT_PYTHON_3_10 }}/*.xml
check_name: Unit test report
- name: Publish unit test report Python 3.11
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ env.UNIT_TEST_REPORT_PYTHON_3_11 }}/*.xml
check_name: Unit test report
- name: Publish integration test report Python 3.11
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ env.INTEGRATION_TEST_REPORT_PYTHON_3_11 }}/*.xml
check_name: SDK integration test report
send-slack-notification:
name: Send notification
runs-on: ubuntu-20.04
needs: [ publish-test-reports ]
if: always()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get workflow status
uses: technote-space/workflow-conclusion-action@v2
- name: Send Slack notification
uses: ./.github/actions/send-slack-notification
with:
success-parameter: ${{ env.WORKFLOW_CONCLUSION }}
failure-channel: ${{ secrets.SLACK_FAILURE_CHANNEL_ID }}
failure-message: This pipeline has failed!