-
Notifications
You must be signed in to change notification settings - Fork 6
252 lines (251 loc) · 11.9 KB
/
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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: Test
run-name: "#${{ github.run_number }} test by ${{ github.triggering_actor }}"
on:
pull_request:
paths:
- "testit-adapter-cucumber4/**"
- "testit-adapter-cucumber5/**"
- "testit-adapter-cucumber6/**"
- "testit-adapter-cucumber7/**"
- "testit-adapter-jbehave/**"
- "testit-adapter-junit4/**"
- "testit-adapter-junit5/**"
- "testit-adapter-selenide/**"
- "testit-adapter-testng/**"
- "testit-java-commons/**"
- "build.gradle.kts"
- "gradle.properties"
- "settings.gradle.kts"
- ".github/**/test.yml"
workflow_dispatch:
env:
DOTNET_VERSION: 8
GITHUB_PAT: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
JAVA_DISTRIBUTION: "temurin"
JAVA_VERSION: 17
PYTHON_VERSION: 3.12
TEMP_FILE: tmp/output.txt
TMS_ADAPTER_MODE: 1
TMS_CERT_VALIDATION: false
TMS_PRIVATE_TOKEN: ${{ secrets.TESTIT_PRIVATE_TOKEN }}
TMS_URL: ${{ secrets.TESTIT_URL }}
jobs:
test-gradle:
name: ${{ matrix.project_name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# - project_name: cucubmer7-gradle-testng
# configuration_id: CUCUMBER7_GRADLE_TESTNG_CONFIGURATION_ID
# project_id: CUCUMBER7_GRADLE_TESTNG_PROJECT_ID
# - project_name: cucumber7-gradle-junit4
# configuration_id: CUCUMBER7_GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: CUCUMBER7_GRADLE_JUNIT4_PROJECT_ID
# - project_name: gradle-junit4
# configuration_id: GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: GRADLE_JUNIT4_PROJECT_ID
# - project_name: gradle-junit5
# configuration_id: GRADLE_JUNIT5_CONFIGURATION_ID
# project_id: GRADLE_JUNIT5_PROJECT_ID
# - project_name: gradle-testng
# configuration_id: GRADLE_TESTNG_CONFIGURATION_ID
# project_id: GRADLE_TESTNG_PROJECT_ID
- project_name: jbehave-gradle-junit4
configuration_id: JBEHAVE_GRADLE_JUNIT4_CONFIGURATION_ID
project_id: JBEHAVE_GRADLE_JUNIT4_PROJECT_ID
# - project_name: jbehave-gradle-testng
# configuration_id: JBEHAVE_GRADLE_TESTNG_CONFIGURATION_ID
# project_id: JBEHAVE_GRADLE_TESTNG_PROJECT_ID
# - project_name: cucumber7-gradle-junit5
# configuration_id: CUCUMBER7_GRADLE_JUNIT5_CONFIGURATION_ID
# project_id: CUCUMBER7_GRADLE_JUNIT5_PROJECT_ID
# - project_name: jbehave-gradle-junit5
# configuration_id: JBEHAVE_GRADLE_JUNIT5_CONFIGURATION_ID
# project_id: JBEHAVE_GRADLE_JUNIT5_PROJECT_ID
# - project_name: cucubmer4-gradle-testng
# configuration_id: CUCUMBER4_GRADLE_TESTNG_CONFIGURATION_ID
# project_id: CUCUMBER4_GRADLE_TESTNG_PROJECT_ID
# - project_name: cucubmer5-gradle-testng
# configuration_id: CUCUMBER5_GRADLE_TESTNG_CONFIGURATION_ID
# project_id: CUCUMBER5_GRADLE_TESTNG_PROJECT_ID
# - project_name: cucubmer6-gradle-testng
# configuration_id: CUCUMBER6_GRADLE_TESTNG_CONFIGURATION_ID
# project_id: CUCUMBER6_GRADLE_TESTNG_PROJECT_ID
# - project_name: cucumber4-gradle-junit4
# configuration_id: CUCUMBER4_GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: CUCUMBER4_GRADLE_JUNIT4_PROJECT_ID
# - project_name: cucumber5-gradle-junit4
# configuration_id: CUCUMBER5_GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: CUCUMBER5_GRADLE_JUNIT4_PROJECT_ID
# - project_name: cucumber5-gradle-junit5
# configuration_id: CUCUMBER5_GRADLE_JUNIT5_CONFIGURATION_ID
# project_id: CUCUMBER5_GRADLE_JUNIT5_PROJECT_ID
# - project_name: cucumber6-gradle-junit4
# configuration_id: CUCUMBER6_GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: CUCUMBER6_GRADLE_JUNIT4_PROJECT_ID
# - project_name: cucumber6-gradle-junit5
# configuration_id: CUCUMBER6_GRADLE_JUNIT5_CONFIGURATION_ID
# project_id: CUCUMBER6_GRADLE_JUNIT5_PROJECT_ID
# - project_name: selenide-gradle-junit5
# configuration_id: SELENIDE_GRADLE_JUNIT5_CONFIGURATION_ID
# project_id: SELENIDE_GRADLE_JUNIT5_PROJECT_ID
# - project_name: serenity2-gradle-junit4
# configuration_id: SERENITY2_GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: SERENITY2_GRADLE_JUNIT4_PROJECT_ID
# - project_name: serenity3-gradle-junit4
# configuration_id: SERENITY3_GRADLE_JUNIT4_CONFIGURATION_ID
# project_id: SERENITY3_GRADLE_JUNIT4_PROJECT_ID
env:
TMS_CONFIGURATION_ID: ${{ secrets[matrix.configuration_id] }}
TMS_PROJECT_ID: ${{ secrets[matrix.project_id] }}
TMS_TEST_RUN_NAME: ${{ matrix.project_name }} TestRun
steps:
- name: Checkout adapters-java
uses: actions/checkout@v4
- name: Checkout api-validator-dotnet
uses: actions/checkout@v4
with:
repository: testit-tms/api-validator-dotnet
token: ${{ env.GITHUB_PAT }}
path: api-validator-dotnet
- name: Checkout java-examples
uses: actions/checkout@v4
with:
repository: testit-tms/java-examples
path: java-examples
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-package: jdk
java-version: ${{ env.JAVA_VERSION }}
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup environment
run: |
./gradlew --no-daemon -DdisableSign=true publishToMavenLocal
dotnet build --configuration Debug --property WarningLevel=0 api-validator-dotnet
pip install testit-cli
- name: Create TestRun
run: |
testit testrun create --token ${{ env.TMS_PRIVATE_TOKEN }} --output ${{ env.TEMP_FILE }}
echo "TMS_TEST_RUN_ID=$(<${{ env.TEMP_FILE }})" >> $GITHUB_ENV
- name: Test
run: |
cd java-examples/${{ matrix.project_name }}
chmod +x ./gradlew
./gradlew test --no-daemon -DtmsUrl=${{ env.TMS_URL }} -DtmsPrivateToken=${{ env.TMS_PRIVATE_TOKEN }} -DtmsProjectId=${{ env.TMS_PROJECT_ID }} -DtmsConfigurationId=${{ env.TMS_CONFIGURATION_ID }} -DtmsAdapterMode=${{ env.TMS_ADAPTER_MODE }} -DtmsTestRunId=${{ env.TMS_TEST_RUN_ID }} -DtmsCertValidation=${{ env.TMS_CERT_VALIDATION }} || exit 0
- name: Validate
run: |
dotnet test --configuration Debug --no-build --logger:"console;verbosity=detailed" api-validator-dotnet
# test-maven:
# name: ${{ matrix.project_name }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# include:
# - project_name: cucumber6-maven-junit4
# configuration_id: CUCUMBER6_MAVEN_JUNIT4_CONFIGURATION_ID
# project_id: CUCUMBER6_MAVEN_JUNIT4_PROJECT_ID
# - project_id: CUCUMBER6_MAVEN_TESTNG_PROJECT_ID
# configuration_id: CUCUMBER6_MAVEN_TESTNG_CONFIGURATION_ID
# project_name: cucumber6-maven-testng
# - project_name: jbehave-maven-junit4
# configuration_id: JBEHAVE_MAVEN_JUNIT4_CONFIGURATION_ID
# project_id: JBEHAVE_MAVEN_JUNIT4_PROJECT_ID
# - project_name: jbehave-maven-testng
# configuration_id: JBEHAVE_MAVEN_TESTNG_CONFIGURATION_ID
# project_id: JBEHAVE_MAVEN_TESTNG_PROJECT_ID
# - project_name: maven-junit4
# configuration_id: MAVEN_JUNIT4_CONFIGURATION_ID
# project_id: MAVEN_JUNIT4_PROJECT_ID
# - project_name: maven-junit5
# configuration_id: MAVEN_JUNIT5_CONFIGURATION_ID
# project_id: MAVEN_JUNIT5_PROJECT_ID
# - project_name: maven-testng
# configuration_id: MAVEN_TESTNG_CONFIGURATION_ID
# project_id: MAVEN_TESTNG_PROJECT_ID
# # - project_name: jbehave-maven-junit5
# # configuration_id: JBEHAVE_MAVEN_JUNIT5_CONFIGURATION_ID
# # project_id: JBEHAVE_MAVEN_JUNIT5_PROJECT_ID
# # - project_name: cucumber6-maven-junit5
# # configuration_id: CUCUMBER6_MAVEN_JUNIT5_CONFIGURATION_ID
# # project_id: CUCUMBER6_MAVEN_JUNIT5_PROJECT_ID
# # - project_name: cucumber4-maven-junit4
# # configuration_id: CUCUMBER4_MAVEN_JUNIT4_CONFIGURATION_ID
# # project_id: CUCUMBER4_MAVEN_JUNIT4_PROJECT_ID
# # - project_name: cucumber4-maven-testng
# # configuration_id: CUCUMBER4_MAVEN_TESTNG_CONFIGURATION_ID
# # project_id: CUCUMBER4_MAVEN_TESTNG_PROJECT_ID
# # - project_name: cucumber5-maven-junit4
# # configuration_id: CUCUMBER5_MAVEN_JUNIT4_CONFIGURATION_ID
# # project_id: CUCUMBER5_MAVEN_JUNIT4_PROJECT_ID
# # - project_name: cucumber5-maven-junit5
# # configuration_id: CUCUMBER5_MAVEN_JUNIT5_CONFIGURATION_ID
# # project_id: CUCUMBER5_MAVEN_JUNIT5_PROJECT_ID
# # - project_name: cucumber5-maven-testng
# # configuration_id: CUCUMBER5_MAVEN_TESTNG_CONFIGURATION_ID
# # project_id: CUCUMBER5_MAVEN_TESTNG_PROJECT_ID
# # - project_name: cucumber7-maven-junit4
# # configuration_id: CUCUMBER7_MAVEN_JUNIT4_CONFIGURATION_ID
# # project_id: CUCUMBER7_MAVEN_JUNIT4_PROJECT_ID
# # - project_name: cucumber7-maven-junit5
# # configuration_id: CUCUMBER7_MAVEN_JUNIT5_CONFIGURATION_ID
# # project_id: CUCUMBER7_MAVEN_JUNIT5_PROJECT_ID
# env:
# TMS_CONFIGURATION_ID: ${{ secrets[matrix.configuration_id] }}
# TMS_PROJECT_ID: ${{ secrets[matrix.project_id] }}
# TMS_TEST_RUN_NAME: ${{ matrix.project_name }} TestRun
# steps:
# - name: Checkout adapters-java
# uses: actions/checkout@v4
# - name: Checkout api-validator-dotnet
# uses: actions/checkout@v4
# with:
# repository: testit-tms/api-validator-dotnet
# token: ${{ env.GITHUB_PAT }}
# path: api-validator-dotnet
# - name: Checkout java-examples
# uses: actions/checkout@v4
# with:
# repository: testit-tms/java-examples
# path: java-examples
# - name: Setup dotnet
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: ${{ env.DOTNET_VERSION }}
# - name: Setup java
# uses: actions/setup-java@v4
# with:
# distribution: ${{ env.JAVA_DISTRIBUTION }}
# java-package: jdk
# java-version: ${{ env.JAVA_VERSION }}
# - name: Setup python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: Setup environment
# run: |
# ./gradlew --no-daemon -DdisableSign=true publishToMavenLocal
# dotnet build --configuration Debug --property WarningLevel=0 api-validator-dotnet
# pip install testit-cli
# - name: Create TestRun
# run: |
# testit testrun create --token ${{ env.TMS_PRIVATE_TOKEN }} --output ${{ env.TEMP_FILE }}
# echo "TMS_TEST_RUN_ID=$(<${{ env.TEMP_FILE }})" >> $GITHUB_ENV
# - name: Test
# run: |
# cd java-examples/${{ matrix.project_name }}
# mvn test -DtmsUrl=${{ env.TMS_URL }} -DtmsPrivateToken=${{ env.TMS_PRIVATE_TOKEN }} -DtmsProjectId=${{ env.TMS_PROJECT_ID }} -DtmsConfigurationId=${{ env.TMS_CONFIGURATION_ID }} -DtmsAdapterMode=${{ env.TMS_ADAPTER_MODE }} -DtmsTestRunId=${{ env.TMS_TEST_RUN_ID }} -DtmsCertValidation=${{ env.TMS_CERT_VALIDATION }} || exit 0
# - name: Validate
# run: |
# dotnet test --configuration Debug --no-build --logger:"console;verbosity=detailed" api-validator-dotnet