88
99env :
1010 JAVA_VERSION : 17
11- NATIVE_VERSION : 22.3.2
12- GRAALVM_DIST : graalvm-community
1311 JAVA_DISTRO : temurin
12+ NATIVE_JAVA_VERSION : 23
13+ GRAALVM_DIST : graalvm-community
1414 FAIL_ISSUE : 141
1515
16- permissions :
17- contents : read
18- actions : read
16+ permissions : read-all
1917
2018jobs :
2119 cache-setup :
@@ -25,12 +23,13 @@ jobs:
2523
2624 steps :
2725 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+ with :
27+ fetch-depth : 1
2828
2929 - name : Pf2e Tools release cache key
3030 id : test-data-key
3131 run : |
32- LATEST_RELEASE=$(curl -sLH 'Accept: application/json' https://api.github.com/repos/Pf2eToolsOrg/Pf2eTools/releases/latest)
33- LATEST_VERSION=$(echo $LATEST_RELEASE | grep tag_name | sed -e 's/.*"tag_name": "\([^"]*\)".*/\1/')
32+ LATEST_VERSION=$(curl -sLH 'Accept: application/json' https://api.github.com/repos/Pf2eToolsOrg/Pf2eTools/releases/latest | jq -r .tag_name)
3433 echo $LATEST_VERSION
3534
3635 echo "🔹 Use $LATEST_VERSION"
4140 id : test-data-check
4241 uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
4342 with :
44- path : sources/Pf2eTools
43+ path : sources
4544 key : ${{ steps.test-data-key.outputs.cache_key }}
4645 lookup-only : true
4746 enableCrossOsArchive : true
@@ -51,20 +50,20 @@ jobs:
5150 if : steps.test-data-check.outputs.cache-hit != 'true'
5251 env :
5352 LATEST_VERSION : ${{ steps.test-data-key.outputs.tools_version }}
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5454 run : |
55+ mkdir -p sources
56+
5557 echo "🔹 Download $LATEST_VERSION"
56- ARTIFACT_URL="https://github.com/Pf2eToolsOrg/Pf2eTools/archive/refs/tags/$LATEST_VERSION.tar.gz"
57- VER=$(echo $LATEST_VERSION | cut -c 2-)
58- ROOT="Pf2eTools-$VER"
5958
60- curl -LsS -o Pf2eTools.tar.gz $ARTIFACT_URL
61- tar xzf Pf2eTools.tar.gz ${ROOT}/data ${ROOT}/img
59+ gh repo clone Pf2eToolsOrg/Pf2eTools sources/Pf2eTools -- --depth=1 -c advice.detachedHead=false -b $LATEST_VERSION
60+
6261 # Remove image contents. We just need the files to exist (linking)
63- find ${ROOT}/img -type f | while read FILE; do echo > "$FILE"; done
62+ find sources -type f -type f \
63+ \( -iname \*.jpg -o -iname \*.png -o -iname \*.webp \) \
64+ | while read FILE; do echo > "$FILE"; done
6465
65- mkdir -p sources
66- rm -rf sources/Pf2eTools
67- mv ${ROOT} sources/Pf2eTools
66+ ls -al sources
6867
6968 test-with-data :
7069
@@ -74,11 +73,13 @@ jobs:
7473
7574 steps :
7675 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76+ with :
77+ fetch-depth : 1
7778
7879 - uses : actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
7980 id : cache
8081 with :
81- path : sources/Pf2eTools
82+ path : sources
8283 key : ${{ needs.cache-setup.outputs.cache_key }}
8384 fail-on-cache-miss : true
8485
9293 - name : Build with Maven
9394 id : mvn-build
9495 run : |
96+ ls -al sources
9597 ./mvnw -B -ntp -DskipFormat verify
9698
9799 native-test-with-data :
@@ -106,54 +108,50 @@ jobs:
106108 os : [windows-latest, macos-latest, ubuntu-latest]
107109
108110 steps :
109-
110111 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
112+ with :
113+ fetch-depth : 1
111114
112115 - uses : actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
113116 id : cache
114117 with :
115- path : sources/Pf2eTools
118+ path : sources
116119 key : ${{ needs.cache-setup.outputs.cache_key }}
117120 fail-on-cache-miss : true
118121 enableCrossOsArchive : true
119122
120123 - uses : graalvm/setup-graalvm@4a200f28cd70d1940b5e33bd00830b7dc71a7e2b # v1.2.6
121124 with :
122125 distribution : ${{ env.GRAALVM_DIST }}
123- java-version : ${{ env.JAVA_VERSION }}
126+ java-version : ${{ env.NATIVE_JAVA_VERSION }}
124127 github-token : ${{ secrets.GITHUB_TOKEN }}
125- version : ${{ env.NATIVE_VERSION }}
126128 cache : ' maven'
127129
128- - name : Build and run
129- id : mvn-build
130- env :
131- MAVEN_OPTS : " -Xmx1g"
132- run : |
133- ./mvnw -B -ntp -DskipFormat verify
134-
135130 - if : runner.os == 'Windows'
136131 name : clean before native build
137132 shell : cmd
138133 run : |
139- ./mvnw -B -ntp -DskipFormat clean
134+ ./mvnw -B -ntp -DskipTests - DskipFormat clean
140135
141- - name : Build and run in native mode
136+ - name : Build, run, and test in native mode
142137 id : mvn-native-build
143- env :
144- MAVEN_OPTS : " -Xmx1g"
145138 run : |
146- ./mvnw -B -ntp -Dnative -DskipTests - DskipFormat verify
139+ ./mvnw -B -ntp -Dnative -DskipFormat verify
147140
148141 report-native-build :
149142
150143 name : Report errors
151144 runs-on : ubuntu-latest
152145 if : ${{ failure() }}
153146 needs : [test-with-data, native-test-with-data]
147+ permissions :
148+ contents : read
149+ issues : write
154150
155151 steps :
156152 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
153+ with :
154+ fetch-depth : 1
157155
158156 - id : gh-issue
159157 env :
0 commit comments