Skip to content

Commit

Permalink
Add custom JDK tmpdir folder under .github/tmpdir for CI to work
Browse files Browse the repository at this point in the history
stupid perms I swear
  • Loading branch information
Tristan971 committed Jan 9, 2025
1 parent 4553d5b commit 39c7030
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Empty file added .github/tmpdir/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion .github/workflows/build-hotspot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ jobs:
${{ runner.os }}-hotspot-maven-${{ inputs.JDK_VENDOR }}-${{ inputs.JDK_VERSION }}-
- name: "Build and test"
run: |
set -euo pipefail
export VERSION="git-$(date -d "$CI_COMMIT_TIMESTAMP" +'%Y%m%d-%H%M')-$CI_COMMIT_SHORT_SHA"
mvn -B -e -fae --show-version -T$(nproc)C -Drevision="$VERSION" verify package
mvn -B -e -fae --show-version -T$(nproc)C -Drevision="$VERSION" -DsurefireTmpDir="$(pwd)/.github/tmpdir" verify package
awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' target/site/jacoco/jacoco.csv
- name: "Archive jarfile"
uses: "actions/upload-artifact@v4"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.iml
.idea
.github/tmpdir
target
zlib/
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<revision>local-SNAPSHOT</revision>
<build.timestamp>${maven.build.timestamp}</build.timestamp>

<surefireTmpDir>${java.io.tmpdir}</surefireTmpDir>

<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-pmd-plugin.version>3.26.0</maven-pmd-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
Expand Down Expand Up @@ -84,7 +86,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>--enable-preview @{jacoco.surefireArgLine} -javaagent:${org.mockito:mockito-core:jar} -Dspring.profiles.active=test</argLine>
<argLine>--enable-preview -Djava.io.tmpdir=${surefireTmpDir} @{jacoco.surefireArgLine} -javaagent:${org.mockito:mockito-core:jar} -Dspring.profiles.active=test</argLine>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
Expand Down

0 comments on commit 39c7030

Please sign in to comment.