@@ -116,13 +116,12 @@ jobs:
116
116
with :
117
117
token : ${{ secrets.CODECOV_TOKEN }}
118
118
flags : funTest-non-docker
119
- funTest-docker :
119
+ funTest-docker-build :
120
120
runs-on : ubuntu-22.04
121
+ outputs :
122
+ # Map a step output to a job output.
123
+ test_image_tag : ${{ steps.final.outputs.test_image_tag }}
121
124
steps :
122
- - name : Checkout Repository
123
- uses : actions/checkout@v4
124
- with :
125
- submodules : recursive
126
125
- name : Free Disk Space
127
126
uses : ./.github/actions/free-disk-space
128
127
- name : Set up Docker Buildx
@@ -135,28 +134,25 @@ jobs:
135
134
tags : ${{ env.TEST_IMAGE_TAG }}
136
135
target : all-tools
137
136
cache-from : type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/ort:cache
138
- - name : Setup Gradle
137
+ - name : Set step output
138
+ id : final
139
+ run : echo "test_image_tag=$TEST_IMAGE_TAG" >> "$GITHUB_OUTPUT"
140
+ funTest-docker :
141
+ needs : funTest-docker-build
142
+ runs-on : ubuntu-22.04
143
+ container :
144
+ image : ${{ needs.funTest-docker-build.outputs.test_image_tag }}
145
+ options : --user 1001
146
+ steps :
147
+ - name : Checkout Repository
148
+ uses : actions/checkout@v4
149
+ with :
150
+ submodules : recursive
151
+ - name : Run functional tests that do require external tools
139
152
uses : gradle/actions/setup-gradle@v3
140
153
with :
141
154
gradle-home-cache-cleanup : true
142
- - name : Run functional tests that do require external tools
143
- run : |
144
- # Change the ownership of the Gradle user home and the workspace to the user in the Docker container.
145
- sudo chown -R 1000:1000 /home/runner/.gradle
146
- sudo chown -R 1000:1000 ${{ github.workspace }}
147
-
148
- # Run the functional tests in the Docker container.
149
- docker run \
150
- -v ${{ github.workspace }}:/workspace \
151
- -v /home/runner/.gradle:/home/ort/.gradle \
152
- -w /workspace \
153
- --entrypoint=/bin/sh \
154
- ${{ env.TEST_IMAGE_TAG }} \
155
- -c "GRADLE_USER_HOME=/home/ort/.gradle ./gradlew --scan -Ptests.include=org.ossreviewtoolkit.plugins.packagemanagers.* funTest jacocoFunTestReport"
156
-
157
- # Change the ownership of the Gradle user home and the workspace back to the user in the GitHub Actions runner.
158
- sudo chown -R 1001:121 /home/runner/.gradle
159
- sudo chown -R 1001:121 ${{ github.workspace }}
155
+ arguments : --scan -Ptests.include=org.ossreviewtoolkit.plugins.packagemanagers.* funTest jacocoFunTestReport
160
156
- name : Upload code coverage data
161
157
uses : codecov/codecov-action@v4
162
158
with :
0 commit comments