Skip to content

Commit

Permalink
ci(github): Run Docker as the GitHub user to simplify code
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Apr 22, 2024
1 parent 2fcae57 commit df6c955
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,18 @@ jobs:
gradle-home-cache-cleanup: true
- name: Run functional tests that do require external tools
run: |
# Change the ownership of the Gradle user home and the workspace to the user in the Docker container.
sudo chown -R 1000:1000 /home/runner/.gradle
sudo chown -R 1000:1000 ${{ github.workspace }}
ls -la /home/runner/.gradle
mkdir -p /home/runner/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/
# Run the functional tests in the Docker container.
docker run \
-v ${{ github.workspace }}:/workspace \
-u 1001:121 \
-v "/var/run/docker.sock":"/var/run/docker.sock" \
-v /home/runner/.gradle:/home/ort/.gradle \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
--entrypoint=/bin/sh \
${{ env.TEST_IMAGE_TAG }} \
-c "GRADLE_USER_HOME=/home/ort/.gradle ./gradlew --scan -Ptests.include=org.ossreviewtoolkit.plugins.packagemanagers.* funTest jacocoFunTestReport"
# Change the ownership of the Gradle user home and the workspace back to the user in the GitHub Actions runner.
sudo chown -R 1001:121 /home/runner/.gradle
sudo chown -R 1001:121 ${{ github.workspace }}
- name: Upload code coverage data
uses: codecov/codecov-action@v4
with:
Expand Down

0 comments on commit df6c955

Please sign in to comment.