-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (131 loc) · 5.17 KB
/
Copy pathci.yml
File metadata and controls
143 lines (131 loc) · 5.17 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
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.8.3.3"
jobs:
build:
name: mcpp (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- platform: linux
os: ubuntu-latest
suffix: linux-x86_64
ext: tar.gz
mcpp: bin/mcpp
xlings: registry/bin/xlings
- platform: macos
os: macos-15
suffix: macosx-arm64
ext: tar.gz
mcpp: bin/mcpp
xlings: registry/bin/xlings
- platform: windows
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 (1022 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: 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
# 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 1022 TUs from source underneath this.
- name: Build the module layer
shell: bash
env:
MCPP_INDEX_MIRROR: GLOBAL
run: '"$MCPP" build'
# 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'
# A real GDExtension shared library -- the shape this package exists for,
# and what caught the missing -fPIC in compat.godot-cpp.
#
# Linux only, and not by choice: mcpp refuses `kind = "shared"` off ELF --
# "PE consumers need an import library and Mach-O needs install-name
# handling; neither is modelled yet, so mcpp refuses rather than producing
# an artifact nothing has ever verified." The library layer itself is
# still built and tested on all three above.
- name: Build the summator GDExtension example
if: runner.os == 'Linux'
shell: bash
working-directory: examples/summator
env:
MCPP_INDEX_MIRROR: GLOBAL
run: '"$MCPP" build'