66 pull_request :
77 branches : [main, master]
88
9+ concurrency :
10+ group : ci-${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+
913jobs :
1014 build-linux :
11- runs-on : ubuntu-latest
15+ name : build + test (linux x86_64, mcpp)
16+ runs-on : ubuntu-24.04
17+ timeout-minutes : 30
18+ env :
19+ MCPP_HOME : /home/runner/.mcpp
1220 steps :
13- - name : Checkout
14- uses : actions/checkout@v4
21+ - uses : actions/checkout@v4
1522
16- - name : Setup xmake
17- uses : xmake-io/github-action-setup-xmake@v1
23+ # mcpp's sandbox (musl-gcc + ninja + binutils) is multi-hundred-MB;
24+ # key on mcpp.toml so toolchain changes refresh the cache.
25+ - name : Cache mcpp sandbox
26+ uses : actions/cache@v4
1827 with :
19- xmake-version : latest
20- package-cache : true
28+ path : ~/.mcpp
29+ key : mcpp-sandbox-${{ runner.os }}-${{ hashFiles('mcpp.toml') }}
30+ restore-keys : |
31+ mcpp-sandbox-${{ runner.os }}-
2132
22- - name : Install dependencies
23- run : |
24- sudo apt-get update
25- sudo apt-get install -y build-essential
26-
27- - name : Install Xlings
28- run : curl -fsSL https://d2learn.org/xlings-install.sh | bash
29-
30- - name : Install GCC 15.1 with Xlings
33+ - name : Cache xlings
34+ uses : actions/cache@v4
35+ with :
36+ path : ~/.xlings
37+ key : xlings-${{ runner.os }}
38+ restore-keys : |
39+ xlings-${{ runner.os }}-
40+
41+ - name : Bootstrap mcpp via xlings
42+ env :
43+ XLINGS_NON_INTERACTIVE : ' 1'
3144 run : |
32- export PATH=/home/xlings/.xlings_data/bin:$PATH
33- xlings install gcc@15.1 -y
45+ if [ ! -x "$HOME/.xlings/subos/default/bin/xlings" ]; then
46+ curl -fsSL https://d2learn.org/xlings-install.sh | bash
47+ fi
48+ export PATH="$HOME/.xlings/subos/default/bin:$PATH"
49+ xlings --version
50+ xlings install mcpp -y
51+ mcpp --version
52+ echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
53+
54+ - name : Cache target/ (build artifacts + BMIs)
55+ uses : actions/cache@v4
56+ with :
57+ path : target
58+ key : mcpp-target-${{ runner.os }}-${{ hashFiles('src/**', 'tests/**', 'mcpp.toml') }}
59+ restore-keys : |
60+ mcpp-target-${{ runner.os }}-
3461
3562 - name : Build
36- run : |
37- export PATH=/home/xlings/.xlings_data/bin:$PATH
38- xmake -y -vv
63+ run : mcpp build
3964
4065 - name : Test
41- run : |
42- export PATH=/home/xlings/.xlings_data/bin:$PATH
43- xmake run cmdline_test
44-
45- - name : Run examples (smoke)
46- run : |
47- export PATH=/home/xlings/.xlings_data/bin:$PATH
48- xmake run with_dispatch -- add python 3.12
49- xmake run with_dispatch -- remove foo
66+ run : mcpp test
5067
68+ # mcpp is Linux-x86_64 first; macOS/Windows support is still WIP, so the
69+ # cross-platform xmake build keeps coverage for those targets.
5170 build-macos :
71+ name : build (macOS, xmake)
5272 runs-on : macos-latest
5373 steps :
54- - name : Checkout
55- uses : actions/checkout@v4
74+ - uses : actions/checkout@v4
5675
5776 - name : Setup xmake
5877 uses : xmake-io/github-action-setup-xmake@v1
@@ -69,10 +88,10 @@ jobs:
6988 xmake -y -vv
7089
7190 build-windows :
91+ name : build + test (Windows, xmake)
7292 runs-on : windows-latest
7393 steps :
74- - name : Checkout
75- uses : actions/checkout@v4
94+ - uses : actions/checkout@v4
7695
7796 - name : Setup xmake
7897 uses : xmake-io/github-action-setup-xmake@v1
0 commit comments