-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (93 loc) · 2.9 KB
/
ci.yml
File metadata and controls
111 lines (93 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
name: build + test (linux x86_64, mcpp)
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
MCPP_HOME: /home/runner/.mcpp
steps:
- uses: actions/checkout@v4
# mcpp's sandbox (musl-gcc + ninja + binutils) is multi-hundred-MB;
# key on mcpp.toml so toolchain changes refresh the cache.
- name: Cache mcpp sandbox
uses: actions/cache@v4
with:
path: ~/.mcpp
key: mcpp-sandbox-${{ runner.os }}-${{ hashFiles('mcpp.toml') }}
restore-keys: |
mcpp-sandbox-${{ runner.os }}-
- name: Cache xlings
uses: actions/cache@v4
with:
path: ~/.xlings
key: xlings-${{ runner.os }}
restore-keys: |
xlings-${{ runner.os }}-
- name: Bootstrap mcpp via xlings
env:
XLINGS_NON_INTERACTIVE: '1'
run: |
if [ ! -x "$HOME/.xlings/subos/default/bin/xlings" ]; then
curl -fsSL https://d2learn.org/xlings-install.sh | bash
fi
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
xlings --version
xlings install mcpp -y
mcpp --version
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
- name: Cache target/ (build artifacts + BMIs)
uses: actions/cache@v4
with:
path: target
key: mcpp-target-${{ runner.os }}-${{ hashFiles('src/**', 'tests/**', 'mcpp.toml') }}
restore-keys: |
mcpp-target-${{ runner.os }}-
- name: Build
run: mcpp build
- name: Test
run: mcpp test
# mcpp is Linux-x86_64 first; macOS/Windows support is still WIP, so the
# cross-platform xmake build keeps coverage for those targets.
build-macos:
name: build (macOS, xmake)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
package-cache: true
- name: Install LLVM 20
run: brew install llvm@20
- name: Build
run: |
xmake f --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20
xmake -y -vv
build-windows:
name: build + test (Windows, xmake)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
package-cache: true
- name: Build
run: xmake -y -vv
- name: Test
run: xmake run cmdline_test
- name: Run examples (smoke)
run: |
xmake run with_dispatch -- add python 3.12
xmake run with_dispatch -- remove foo