Skip to content

Commit 7d20291

Browse files
committed
fix: ci-fresh-install — build PR's mcpp then test fresh user flow
Restore PR trigger. Flow: 1. Bootstrap xlings + old mcpp via xlings install 2. Build THIS PR's mcpp from source (self-host) 3. Use freshly-built mcpp to simulate fresh user: new → run 4. Linux: test both GCC (default) and LLVM toolchains 5. macOS: test LLVM (default) 6. Windows: test LLVM + MSVC STL
1 parent a7ef218 commit 7d20291

1 file changed

Lines changed: 96 additions & 29 deletions

File tree

Lines changed: 96 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
name: ci-fresh-install
22

3-
# Fresh install CI — simulates a real first-time user on a clean machine.
4-
# No caches, no env overrides, no self-host. Just:
5-
# 1. Install xlings
6-
# 2. Install mcpp via xlings
7-
# 3. mcpp new hello → cd hello → mcpp run
3+
# Fresh install CI — validates the first-time user experience on all platforms.
4+
# No sandbox/target caches: simulates a user who just installed mcpp.
5+
#
6+
# Flow: bootstrap mcpp via xlings → build this PR's mcpp from source →
7+
# use the freshly-built mcpp to: new → run (default toolchain)
8+
# then: install llvm → new → run
9+
#
10+
# This catches issues that cached CI misses:
11+
# - Incomplete sysroot (missing linux kernel headers)
12+
# - Stale toolchain cfg/specs paths
13+
# - Missing xpkg dependencies
814

915
on:
10-
# Manual trigger only — this CI tests the xlings-distributed mcpp binary
11-
# (not the PR's code). It validates the real user install flow and will
12-
# fail until fixes are released to the xlings mcpp package.
13-
# Run manually after a release to verify the end-to-end user experience.
16+
push:
17+
branches: [ main ]
18+
pull_request:
19+
branches: [ main ]
1420
workflow_dispatch:
1521

1622
concurrency:
@@ -21,65 +27,126 @@ jobs:
2127
linux-fresh:
2228
name: Linux fresh install
2329
runs-on: ubuntu-24.04
24-
timeout-minutes: 30
30+
timeout-minutes: 45
2531
steps:
26-
- name: Install xlings
32+
- uses: actions/checkout@v4
33+
34+
- name: Bootstrap xlings + mcpp
35+
env:
36+
XLINGS_NON_INTERACTIVE: '1'
2737
run: |
2838
curl -fsSL https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-linux-x86_64.tar.gz -o /tmp/xlings.tar.gz
2939
tar -xzf /tmp/xlings.tar.gz -C /tmp
3040
/tmp/xlings-0.4.30-linux-x86_64/subos/default/bin/xlings self install
3141
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
3242
33-
- name: Install mcpp
34-
run: xlings install mcpp -y
43+
- name: Install bootstrap mcpp
44+
run: |
45+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
46+
xlings install mcpp -y
3547
36-
- name: "mcpp new hello → mcpp run"
48+
- name: Build this PR's mcpp from source
3749
run: |
38-
mcpp new hello
50+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
51+
export MCPP_VENDORED_XLINGS="$HOME/.xlings/subos/default/bin/xlings"
52+
mcpp build
53+
MCPP_FRESH=$(realpath "$(find target -type f -name mcpp -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)")
54+
echo "MCPP=$MCPP_FRESH" >> "$GITHUB_ENV"
55+
echo "XLINGS_BIN=$HOME/.xlings/subos/default/bin/xlings" >> "$GITHUB_ENV"
56+
57+
- name: "Fresh: mcpp new hello → mcpp run (GCC)"
58+
run: |
59+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
60+
cd "$(mktemp -d)"
61+
"$MCPP" new hello
3962
cd hello
40-
mcpp run
63+
"$MCPP" run
64+
65+
- name: "Fresh: install LLVM → mcpp new hello → mcpp run"
66+
run: |
67+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
68+
"$MCPP" toolchain install llvm 20.1.7
69+
"$MCPP" toolchain default llvm@20.1.7
70+
cd "$(mktemp -d)"
71+
"$MCPP" new hello_llvm
72+
cd hello_llvm
73+
"$MCPP" run
4174
4275
macos-fresh:
4376
name: macOS fresh install
4477
runs-on: macos-15
4578
timeout-minutes: 30
4679
steps:
47-
- name: Install xlings
80+
- uses: actions/checkout@v4
81+
82+
- name: Bootstrap xlings + mcpp
83+
env:
84+
XLINGS_NON_INTERACTIVE: '1'
4885
run: |
4986
curl -fsSL https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-macosx-arm64.tar.gz -o /tmp/xlings.tar.gz
5087
tar -xzf /tmp/xlings.tar.gz -C /tmp
5188
/tmp/xlings-0.4.30-macosx-arm64/subos/default/bin/xlings self install
5289
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
5390
54-
- name: Install mcpp
55-
run: xlings install mcpp -y
91+
- name: Install bootstrap mcpp
92+
run: |
93+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
94+
xlings install mcpp -y
5695
57-
- name: "mcpp new hello → mcpp run"
96+
- name: Build this PR's mcpp from source
5897
run: |
59-
mcpp new hello
98+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
99+
export MCPP_VENDORED_XLINGS="$HOME/.xlings/subos/default/bin/xlings"
100+
mcpp build
101+
MCPP_FRESH=$(find target -type f -name mcpp ! -name '*.o' | head -1)
102+
echo "MCPP=$(cd "$(dirname "$MCPP_FRESH")" && pwd)/$(basename "$MCPP_FRESH")" >> "$GITHUB_ENV"
103+
echo "XLINGS_BIN=$HOME/.xlings/subos/default/bin/xlings" >> "$GITHUB_ENV"
104+
105+
- name: "Fresh: mcpp new hello → mcpp run (LLVM)"
106+
run: |
107+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
108+
cd "$(mktemp -d)"
109+
"$MCPP" new hello
60110
cd hello
61-
mcpp run
111+
"$MCPP" run
62112
63113
windows-fresh:
64114
name: Windows fresh install
65115
runs-on: windows-latest
66116
timeout-minutes: 30
67117
steps:
68-
- name: Install xlings
118+
- uses: actions/checkout@v4
119+
120+
- name: Bootstrap xlings + mcpp
69121
shell: pwsh
122+
env:
123+
XLINGS_NON_INTERACTIVE: '1'
70124
run: |
71125
Invoke-WebRequest -Uri "https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-windows-x86_64.zip" -OutFile "$env:TEMP\xlings.zip"
72126
Expand-Archive -Path "$env:TEMP\xlings.zip" -DestinationPath "$env:TEMP\xlings-extract" -Force
73127
& "$env:TEMP\xlings-extract\xlings-0.4.30-windows-x86_64\subos\default\bin\xlings.exe" self install
74128
"$env:USERPROFILE\.xlings\subos\default\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
75129
76-
- name: Install mcpp
130+
- name: Install bootstrap mcpp
77131
shell: pwsh
78132
run: xlings install mcpp -y
79133

80-
- name: "mcpp new hello → mcpp run"
81-
shell: pwsh
134+
- name: Build this PR's mcpp from source
135+
shell: bash
136+
run: |
137+
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
138+
export MCPP_VENDORED_XLINGS="$USERPROFILE/.xlings/subos/default/bin/xlings.exe"
139+
mcpp build
140+
MCPP_FRESH=$(find target -type f -name 'mcpp.exe' | head -1)
141+
echo "MCPP=$(realpath "$MCPP_FRESH")" >> "$GITHUB_ENV"
142+
echo "XLINGS_BIN=$USERPROFILE/.xlings/subos/default/bin/xlings.exe" >> "$GITHUB_ENV"
143+
144+
- name: "Fresh: mcpp new hello → mcpp run"
145+
shell: bash
82146
run: |
83-
mcpp new hello
84-
Set-Location hello
85-
mcpp run
147+
export PATH="$USERPROFILE/.xlings/subos/default/bin:$PATH"
148+
export MCPP_VENDORED_XLINGS="$XLINGS_BIN"
149+
cd "$(mktemp -d)"
150+
"$MCPP" new hello
151+
cd hello
152+
"$MCPP" run

0 commit comments

Comments
 (0)