Repository navigation
178 lines (161 loc) · 6.42 KB
/
Copy pathci.yml
File metadata and controls
178 lines (161 loc) · 6.42 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
# Keep in sync with mcpp-index's .github/workflows/validate.yml MCPP_VERSION:
# this package is consumed from that index, so it should be exercised with
# the client that index pins.
MCPP_VERSION: "2026.10.24.1"
jobs:
build:
name: mcpp (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- platform: linux
toolchain: gcc@16.1.0
os: ubuntu-latest
suffix: linux-x86_64
ext: tar.gz
mcpp: bin/mcpp
xlings: registry/bin/xlings
- platform: macos
toolchain: llvm@23.1.3
os: macos-15
suffix: macosx-arm64
ext: tar.gz
mcpp: bin/mcpp
xlings: registry/bin/xlings
- platform: windows
toolchain: llvm@23.1.3
os: windows-latest
suffix: windows-x86_64
ext: zip
mcpp: bin/mcpp.exe
xlings: registry/bin/xlings.exe
steps:
- name: Checkout
uses: actions/checkout@v4
# Holds the toolchains AND the built compat.godot-cpp (1089 TUs), so a
# repeat run rebuilds little. Keyed off the tracked inputs only --
# `git ls-files -s` reads the index, so build output can never enter the
# hash the way a hashFiles() glob would.
- name: Mwrap identity and bilingual README contract
run: |
python3 tools/check_mwrap_release.py
python3 tools/test_gen_module_cppm.py
- name: Compute registry cache key
shell: bash
run: |
h=$(git ls-files -s | git hash-object --stdin)
echo "REGISTRY_CACHE_KEY=mcpp-registry-${{ runner.os }}-${{ env.MCPP_VERSION }}-$h" >> "$GITHUB_ENV"
- name: Restore mcpp registry cache
uses: actions/cache@v4
with:
path: ~/.mcpp/registry
key: ${{ env.REGISTRY_CACHE_KEY }}
restore-keys: |
mcpp-registry-${{ runner.os }}-${{ env.MCPP_VERSION }}-
# Download the release directly rather than going through xlings'
# quick_install.sh: that installer has no Windows path at all ("[xlings]:
# Unsupported OS: MINGW64_NT-10.0-26100"), and pinning the archive gives
# the same client mcpp-index CI uses. Same steps as that workflow.
- name: Download mcpp
shell: bash
env:
MCPP_ARCHIVE: mcpp-${{ env.MCPP_VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}
MCPP_ROOT: mcpp-${{ env.MCPP_VERSION }}-${{ matrix.suffix }}
run: |
curl -L -fsS -o "$MCPP_ARCHIVE" \
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${MCPP_ARCHIVE}"
case "$MCPP_ARCHIVE" in
*.zip) powershell -NoProfile -Command "Expand-Archive -Force -Path '${MCPP_ARCHIVE}' -DestinationPath '.'" ;;
*) tar -xzf "$MCPP_ARCHIVE" ;;
esac
root="$PWD/$MCPP_ROOT"
mkdir -p "$HOME/.mcpp/registry"
cp -a "$root/registry/." "$HOME/.mcpp/registry/"
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "MCPP=$(cygpath -m "$root/${{ matrix.mcpp }}")" >> "$GITHUB_ENV"
echo "MCPP_VENDORED_XLINGS=$(cygpath -m "$root/${{ matrix.xlings }}")" >> "$GITHUB_ENV"
echo "$(cygpath -m "$root/bin")" >> "$GITHUB_PATH"
else
echo "MCPP=$root/${{ matrix.mcpp }}" >> "$GITHUB_ENV"
echo "MCPP_VENDORED_XLINGS=$root/${{ matrix.xlings }}" >> "$GITHUB_ENV"
echo "$root/bin" >> "$GITHUB_PATH"
fi
# compat.godot-cpp is newer than the index snapshot the release vendors
# (and than any restored cache), so refresh before resolving.
- name: Refresh the published package index
shell: bash
env:
MCPP_INDEX_MIRROR: GLOBAL
run: |
"$MCPP" --version
"$MCPP" index update
- name: Checkout candidate SDK index
uses: actions/checkout@v4
with:
repository: mcpplibs/mcpp-index
ref: feat/mwrap-opencv-onnxruntime
path: .candidate-index
- name: Route the unpublished SDK through the candidate compat view
shell: bash
run: |
python3 - <<'PYTHON'
import json
from pathlib import Path
import subprocess
import sys
source = Path('.candidate-index').resolve()
subprocess.run([sys.executable, str(source / 'tests/prepare_mwrap_indices.py')], check=True)
view = source / 'tests/mwrap/.indices/compat'
for manifest in (Path('mcpp.toml'), Path('examples/summator/mcpp.toml')):
with manifest.open('a', encoding='utf-8') as output:
output.write('\n[indices.compat]\npath = ' + json.dumps(view.as_posix()) + '\n')
PYTHON
# No explicit toolchain: mcpp picks the platform default (gcc on Linux,
# LLVM on macOS/Windows), which is what a consumer gets and what
# mcpp-index CI exercises.
# Cold: compat.godot-cpp builds 1089 TUs from source underneath this.
- name: Build the module layer
shell: bash
env:
MCPP_INDEX_MIRROR: GLOBAL
run: '"$MCPP" build --strict'
# tests/godot_cpp_module.cpp -- the import surface
# tests/godot_cpp_macros.cpp -- GDCLASS next to the import
- name: Run tests
shell: bash
env:
MCPP_INDEX_MIRROR: GLOBAL
run: '"$MCPP" test --strict'
- name: Actual default scaffold, strict build and standalone math
shell: bash
env:
MCPP_INDEX_MIRROR: GLOBAL
run: python3 tools/test_template.py --mcpp "$MCPP" --toolchain "${{ matrix.toolchain }}" --index .candidate-index
# Verify the native shared-library shape on every supported platform.
# Loading this library still requires a matching Godot process.
- name: Build the summator GDExtension example
shell: bash
working-directory: examples/summator
env:
MCPP_INDEX_MIRROR: GLOBAL
run: '"$MCPP" build --strict'
- name: Verify the Windows Godot entry point and export boundary
if: runner.os == 'Windows'
shell: bash
run: python3 tools/check_extension_exports.py