@@ -123,8 +123,6 @@ jobs:
123
123
# unit-parallel-tests job will run on ubuntu-latest github-hosted runner
124
124
name : UNIT-PARALLEL-TESTS
125
125
runs-on : ubuntu-latest
126
- outputs :
127
- artifact-name : ${{ steps.set_timestamp.outputs.artifact_name }} # Output the artifact name
128
126
needs : # needs build job and runner-indexes job to be completed before running the unit-parallel-tests job
129
127
- build
130
128
- runner-indexes
@@ -155,11 +153,6 @@ jobs:
155
153
matrix : # defining the matrix strategy to run the job in parallel using x number of github-hosted runners defined in the env total_runners above
156
154
runner-index : ${{ fromjson(needs.runner-indexes.outputs.json) }} # using the runner-indexes job output to define the matrix strategy
157
155
steps :
158
- - name : Set timestamp
159
- id : set_timestamp
160
- run : |
161
- echo "TIMESTAMP=$(date +'%Y-%m-%d-%H-%M-%S')" >> $GITHUB_ENV
162
- echo "::set-output name=artifact_name::test-results-${{ env.TIMESTAMP }}"
163
156
- name : Checkout repository # checkout the repository
164
157
uses : actions/checkout@v3.0.2
165
158
# caching the maven packages to speed up the build process.
@@ -177,7 +170,7 @@ jobs:
177
170
-H "Accept: application/vnd.github+json" \
178
171
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
179
172
-H "X-GitHub-Api-Version: 2022-11-28" \
180
- https://api.github.com/repos/${{ github.repository }}/actions/artifacts | jq -r '.artifacts | sort_by(.created_at) | .[] | select(.name == "^test-results ") | .id' > artifacts_list.txt
173
+ https://api.github.com/repos/${{ github.repository }}/actions/artifacts | jq -r '.artifacts | sort_by(.created_at) | .[] | select(.name == "Test Results ") | .id' > artifacts_list.txt
181
174
182
175
LATEST_ARTIFACT_NUMBER=$(cut -d: -f 2 artifacts_list.txt | sort -n | tail -n 1)
183
176
@@ -218,9 +211,9 @@ jobs:
218
211
mvn -Dtest=$(basename $file | sed -e "s/.java/,/" | tr -d '\r\n') -e test -Dspring.datasource.url=${{ secrets.LIQUIBASE_COMMAND_URL }} -Dspring.datasource.username=${{ secrets.LIQUIBASE_COMMAND_USERNAME }} -Dspring.datasource.password=${{ secrets.LIQUIBASE_COMMAND_PASSWORD }} -Dspring.liquibase.change-log=classpath:db/changelog/changelog_version-3.3.xml -Dserver.port=8086 -Dspring.redis.host=redis -Dspring.redis.port=6379 -Dspring.redis.mode=standalone
219
212
done
220
213
221
- - uses : actions/upload-artifact@v4 # upload the test results as an artifact
214
+ - uses : actions/upload-artifact@v3 # upload the test results as an artifact
222
215
with :
223
- name : test-results-${{ env.TIMESTAMP }} # naming the artifact with the timestamp
216
+ name : Test Results
224
217
path : ./target/surefire-reports # path to the test results
225
218
retention-days : 90 # retention period for the artifact in days. Link to the documentation - https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#about-workflow-artifact-retention
226
219
@@ -234,7 +227,7 @@ jobs:
234
227
- name : Download test results
235
228
uses : actions/download-artifact@v2
236
229
with :
237
- name : test-results-${{ needs.unit-parallel-tests.outputs.artifact-name }}
230
+ name : Test Results
238
231
path : test_results
239
232
240
233
- name : Publish Test Results
@@ -243,7 +236,7 @@ jobs:
243
236
with :
244
237
reporter : java-junit
245
238
name : JUnit Test Results
246
- path : test_results-${{ needs.unit-parallel-tests.outputs.artifact-name }} /*.xml
239
+ path : test_results/*.xml
247
240
248
241
build-and-publish-docker-image : # job to build the docker image and publish it to the GitHub Container Registry
249
242
runs-on : ubuntu-latest # using the latest ubuntu runner
0 commit comments