Skip to content

Commit 3dddc86

Browse files
committed
Use simpler build matrix, split by OS
Rather than a single matrix that covers all OSes, split them up so that enumerating different ones is a little easier. This has three benefits: 1. `matrix.exclude` is easier to write in this format 2. Tools like `act` work with simple string matrix dimensions (see new comment at top of maven.yml) 3. conditional execution on file name pattens are easier to implement (see subsequent PR on this topic) Part of #2714
1 parent b2b1b8a commit 3dddc86

File tree

1 file changed

+46
-9
lines changed

1 file changed

+46
-9
lines changed

.github/workflows/maven.yml

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# This is the main maven workflow for SWT.
22

3+
# You can run this locally to test changes with the act command https://nektosact.com/
4+
# For example, to run all GTK4 tests:
5+
# act -j build-linux --matrix java:21 --artifact-server-path $PWD/.artifacts
6+
# You may need to download runners on first run, act will ask but if you
7+
# want the big runner there is no progress as it downloads, so you can pull it with
8+
# docker directly:
9+
# docker pull catthehacker/ubuntu:full-latest
10+
311
name: SWT Matrix Build
412
concurrency:
513
group: ${{ github.workflow }}-${{ github.ref }}
@@ -25,19 +33,48 @@ jobs:
2533
with:
2634
name: Event File
2735
path: ${{ github.event_path }}
28-
build:
36+
37+
build-linux:
38+
name: Build (Linux)
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
java: ['21']
43+
uses: ./.github/workflows/build.yml
44+
with:
45+
runner: ubuntu-latest
46+
java: ${{ matrix.java }}
47+
native: gtk.linux.x86_64
48+
performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }}
49+
50+
build-windows:
51+
name: Build (Windows)
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
java: ['21']
56+
uses: ./.github/workflows/build.yml
57+
with:
58+
runner: windows-latest
59+
java: ${{ matrix.java }}
60+
native: win32.win32.x86_64
61+
62+
build-macos:
63+
name: Build (macOS)
2964
strategy:
3065
fail-fast: false
3166
matrix:
32-
java: [ '21' ]
33-
config:
34-
- { name: Linux, os: ubuntu-latest, native: gtk.linux.x86_64 }
35-
- { name: Windows, os: windows-latest, native: win32.win32.x86_64 }
36-
- { name: MacOS x86, os: macos-15-intel, native: cocoa.macosx.x86_64 }
37-
- { name: MacOS ARM, os: macos-latest, native: cocoa.macosx.aarch64 }
67+
java: ['21']
68+
native: [cocoa.macosx.x86_64, cocoa.macosx.aarch64]
69+
runner: [macos-15-intel, macos-latest]
70+
exclude:
71+
- runner: macos-latest
72+
native: cocoa.macosx.x86_64
73+
- runner: macos-15-intel
74+
native: cocoa.macosx.aarch64
3875
uses: ./.github/workflows/build.yml
3976
with:
40-
runner: ${{ matrix.config.os }}
77+
runner: ${{ matrix.runner }}
4178
java: ${{ matrix.java }}
42-
native: ${{ matrix.config.native }}
79+
native: ${{ matrix.native }}
4380
performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }}

0 commit comments

Comments
 (0)