Skip to content

Commit 1ab48c7

Browse files
committed
ci(github): Revert to running funTests in a GitHub action container
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent edf431a commit 1ab48c7

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

.github/workflows/build-and-test.yml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,12 @@ jobs:
116116
with:
117117
token: ${{ secrets.CODECOV_TOKEN }}
118118
flags: funTest-non-docker
119-
funTest-docker:
119+
funTest-docker-build:
120120
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 }}
121124
steps:
122-
- name: Checkout Repository
123-
uses: actions/checkout@v4
124-
with:
125-
submodules: recursive
126125
- name: Free Disk Space
127126
uses: ./.github/actions/free-disk-space
128127
- name: Set up Docker Buildx
@@ -135,28 +134,25 @@ jobs:
135134
tags: ${{ env.TEST_IMAGE_TAG }}
136135
target: all-tools
137136
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
139152
uses: gradle/actions/setup-gradle@v3
140153
with:
141154
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
160156
- name: Upload code coverage data
161157
uses: codecov/codecov-action@v4
162158
with:

0 commit comments

Comments
 (0)