You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# # Use only 'java' to analyze code written in Java, Kotlin or both
68
+
# # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
69
+
# # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
69
70
70
71
# defining steps for the job as explained above
71
72
steps:
72
73
- name: Checkout repository
73
-
uses: actions/checkout@v3# cache maven packages step - caching maven packages to speed up the build process. Link to the documentation - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
74
+
uses: actions/checkout@v4.2.2# cache maven packages step - caching maven packages to speed up the build process. Link to the documentation - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
74
75
- name: Cache Maven packages
75
-
uses: actions/cache@v3# defining cache key and restore keys for the cache step. Link to the documentation - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
76
+
uses: actions/cache@v4.1.2# defining cache key and restore keys for the cache step. Link to the documentation - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
76
77
with:
77
78
path: ~/.m2/repository # path to the directory where maven packages are stored - /root/.m2 in the container
category: "/language:${{matrix.language}}"# defining the language for the CodeQL analysis
112
-
- uses: actions/upload-artifact@v3 # uploading the artifact to the GitHub Artifacts. Link to the documentation - https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts
113
+
114
+
- uses: actions/[email protected]# uploading the artifact to the GitHub Artifacts. Link to the documentation - https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts
115
+
if: matrix.language == 'java' # upload the artifact only for the java language
113
116
with:
114
117
name: jar-artifact # naming the artifact jar file/s path
115
118
path: target/ # actual relative path to the artifact in the container - target/
@@ -122,7 +125,7 @@ jobs:
122
125
- build
123
126
- runner-indexes
124
127
container:
125
-
image: mrkostin/maven:3.6.0-alpine-git-curl-jq#ruinning the job in a container - mrkostin/maven:3.6.0-alpine-git-curl-jq
128
+
image: ghcr.io/tsviz/tsvi-spring-test:v2.0.0#using the base maven:3.8.7-openjdk-18 image + jq + curl + nodejs 18
126
129
services:
127
130
# postgres service container
128
131
postgres: # service name - postgres. This name is used to access the service container from the job container as the host name.
@@ -149,52 +152,94 @@ jobs:
149
152
runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }} # using the runner-indexes job output to define the matrix strategy
150
153
steps:
151
154
- name: Checkout repository # checkout the repository
152
-
uses: actions/checkout@v3.0.2
155
+
uses: actions/checkout@v4.2.2
153
156
# caching the maven packages to speed up the build process.
154
157
# Link to the documentation - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
155
158
- name: Cache Maven packages
156
-
uses: actions/cache@v3#using the actions/cache@v3 action to cache the maven packages
159
+
uses: actions/cache@v4.1.2#defining the cache key and restore keys for the cache step. Link to the documentation - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
157
160
with:
158
161
path: /root/.m2 # path to cache
159
162
key: ${{ runner.os }}-junit-${{ hashFiles('**/pom.xml') }} # key for restoring and saving the cache
160
163
restore-keys: ${{ runner.os }}-junit- # key for restoring the cache if no exact match is found
164
+
161
165
# In this step, we are downloading the latest artifact from the build job and storing it in the container
162
-
- run: |
163
-
# Download the latest tests results artifact number from the GitHub API using jq to parse the JSON response
- uses: actions/upload-artifact@v3#upload the test results as an artifact
254
+
- uses: actions/upload-artifact@v4.4.3#uploading the artifact to the GitHub Artifacts. Link to the documentation - https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts
210
255
with:
211
-
name: Test Results
256
+
name: testresults-${{ github.run_id }}-split-${{ matrix.runner-index }} # naming the artifact with the test results
212
257
path: ./target/surefire-reports # path to the test results
213
258
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
build-and-publish-docker-image: # job to build the docker image and publish it to the GitHub Container Registry
216
295
runs-on: ubuntu-latest # using the latest ubuntu runner
217
296
outputs:
@@ -233,24 +312,24 @@ jobs:
233
312
# 6. push the docker image to the GitHub Container Registry
234
313
steps:
235
314
- name: Checkout repository
236
-
uses: actions/checkout@v3
237
-
- uses: actions/download-artifact@v1
315
+
uses: actions/checkout@v4.2.2
316
+
- uses: actions/download-artifact@v4.1.8
238
317
with:
239
318
name: jar-artifact
240
319
path: target/
241
320
242
321
# build the docker image using the Dockerfile in the root of the repository
243
322
# and tag it with the current run number from the github action workflow run
244
323
- name: Log in to the GH Container Registry
245
-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9# using the docker login action from the github marketplace - github.com/marketplace/actions/docker-login
324
+
uses: docker/login-action@v3.3.0# using the docker login action from the github marketplace - github.com/marketplace/actions/docker-login
246
325
with:
247
326
registry: ${{ env.REGISTRY }} # using the registry environment variable
248
327
username: ${{ github.actor }} # using the github.actor context
249
328
password: ${{ secrets.GITHUB_TOKEN }} # using the GITHUB_TOKEN secret
250
329
251
330
- name: Build and push Docker image
252
331
id: build_image
253
-
uses: docker/build-push-action@v4# using the docker build and push action from the github marketplace - github.com/marketplace/actions/build-and-push-docker-images
332
+
uses: docker/build-push-action@v6.9.0# using the docker build and push action from the github marketplace - github.com/marketplace/actions/build-and-push-docker-images
254
333
with:
255
334
context: . # using the current directory as the context
256
335
push: true # push the docker image to the registry
0 commit comments