@@ -11,27 +11,15 @@ concurrency:
1111 cancel-in-progress : true
1212
1313jobs :
14- # Emit a wider matrix on master pushes (adds macOS), narrow on PRs (saves minutes)
15- setup :
16- runs-on : ubuntu-latest
17- outputs :
18- matrix : ${{ steps.set-matrix.outputs.matrix }}
19- steps :
20- - id : set-matrix
21- shell : bash
22- run : |
23- if [[ "${{ github.event_name }}" == "push" ]]; then
24- echo 'matrix={"include":[{"os":"ubuntu-latest"},{"os":"windows-latest"},{"os":"macos-latest"},{"os":"macos-15-intel"}]}' >> "$GITHUB_OUTPUT"
25- else
26- echo 'matrix={"include":[{"os":"ubuntu-latest"},{"os":"windows-latest"}]}' >> "$GITHUB_OUTPUT"
27- fi
28-
14+ # Master pushes exercise every supported host. Pull requests use one Linux job
15+ # so that the normal feedback loop does not spend four runner-minutes on the
16+ # same compiler test suite; the full host matrix still runs before release.
2917 build :
3018 name : Gradle build on ${{ matrix.os }}
31- needs : setup
3219 strategy :
3320 fail-fast : false
34- matrix : ${{ fromJson(needs.setup.outputs.matrix) }}
21+ matrix :
22+ os : ${{ fromJSON(github.event_name == 'push' && '["ubuntu-latest","windows-latest","macos-latest","macos-15-intel"]' || '["ubuntu-latest"]') }}
3523 runs-on : ${{ matrix.os }}
3624 permissions :
3725 checks : write
@@ -96,18 +84,23 @@ jobs:
9684 - name : Setup Gradle (cache)
9785 uses : gradle/actions/setup-gradle@v4
9886
99- # ---- FAIL FAST: package first (so jlink issues show immediately) ----
87+ # Packaging is a release artifact, not a pull-request gate. Keeping it on
88+ # master avoids paying for a second full build on every PR update.
10089 - name : Package slim runtime (fail fast)
90+ if : github.event_name == 'push'
10191 shell : bash
10292 run : ./gradlew packageSlimCompilerDist --no-daemon --stacktrace
10393
10494 - name : Prepare bundled Lua runtime (Linux)
10595 if : runner.os == 'Linux'
10696 shell : bash
10797 run : |
108- if [[ -f src/test/resources/lua53 ]]; then
109- chmod +x src/test/resources/lua53
110- fi
98+ set -euo pipefail
99+ # These binaries are tracked with mode 0644 for cross-platform
100+ # checkouts; make both the interpreter and syntax checker runnable.
101+ chmod +x src/test/resources/lua53 src/test/resources/luac53
102+ src/test/resources/lua53 -e 'assert(_VERSION == "Lua 5.3")'
103+ src/test/resources/luac53 -v
111104
112105 - name : Install Lua compiler (macOS)
113106 if : runner.os == 'macOS'
@@ -119,14 +112,14 @@ jobs:
119112 - name : Run tests
120113 shell : bash
121114 run : |
122- if [[ "${{ runner.os }}" == "Linux" ]]; then
115+ if [[ "${{ github.event_name }}" == "push" && "${{ runner.os }}" == "Linux" ]]; then
123116 ./gradlew test jacocoTestReport --no-daemon --stacktrace --quiet
124117 else
125118 ./gradlew test --no-daemon --stacktrace --quiet
126119 fi
127120
128121 - name : Upload coverage to Coveralls
129- if : runner.os == 'Linux'
122+ if : github.event_name == 'push' && runner.os == 'Linux'
130123 uses : coverallsapp/github-action@v2
131124 with :
132125 github-token : ${{ secrets.GITHUB_TOKEN }}
@@ -157,6 +150,7 @@ jobs:
157150 retention-days : 14
158151
159152 - name : Upload packaged artifact (per-OS)
153+ if : github.event_name == 'push'
160154 uses : actions/upload-artifact@v4
161155 with :
162156 name : wurst-compiler-${{ matrix.os }}
0 commit comments