Skip to content

Commit 9f787ad

Browse files
committed
ci: add fresh-install workflow for first-time user experience
Validates the released mcpp binary via xlings on all platforms: - Linux: xlings install mcpp → mcpp build (self) → mcpp new → mcpp run + install LLVM → mcpp new → mcpp run (continue-on-error) - macOS: xlings install mcpp → mcpp build → mcpp new → mcpp run - Windows: xlings install mcpp → mcpp build → mcpp new → mcpp run No caches — simulates a clean machine. Catches issues like incomplete sysroot, stale cfg paths, missing xpkg dependencies.
1 parent 3f9a369 commit 9f787ad

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: ci-fresh-install
2+
3+
# Fresh install CI — tests the released mcpp via xlings on clean machines.
4+
# Validates: xlings install mcpp → mcpp build (self) → mcpp new → mcpp run
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ci-fresh-install-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
linux-fresh:
19+
name: Linux fresh install
20+
runs-on: ubuntu-24.04
21+
timeout-minutes: 45
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install xlings + mcpp
26+
env:
27+
XLINGS_NON_INTERACTIVE: '1'
28+
run: |
29+
curl -fsSL https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-linux-x86_64.tar.gz | tar -xzf - -C /tmp
30+
/tmp/xlings-0.4.30-linux-x86_64/subos/default/bin/xlings self install
31+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
32+
xlings install mcpp -y
33+
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
34+
35+
- name: mcpp build (self-host)
36+
run: mcpp build
37+
38+
- name: mcpp new hello → mcpp run
39+
run: |
40+
cd "$(mktemp -d)"
41+
mcpp new hello
42+
cd hello
43+
mcpp run
44+
45+
- name: install LLVM → mcpp new → mcpp run
46+
continue-on-error: true
47+
run: |
48+
mcpp self config --mirror GLOBAL
49+
mcpp toolchain install llvm 20.1.7
50+
mcpp toolchain default llvm@20.1.7
51+
cd "$(mktemp -d)"
52+
mcpp new hello_llvm
53+
cd hello_llvm
54+
mcpp run
55+
56+
macos-fresh:
57+
name: macOS fresh install
58+
runs-on: macos-15
59+
timeout-minutes: 30
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Install xlings + mcpp
64+
env:
65+
XLINGS_NON_INTERACTIVE: '1'
66+
run: |
67+
curl -fsSL https://github.com/d2learn/xlings/releases/download/v0.4.30/xlings-0.4.30-macosx-arm64.tar.gz | tar -xzf - -C /tmp
68+
/tmp/xlings-0.4.30-macosx-arm64/subos/default/bin/xlings self install
69+
export PATH="$HOME/.xlings/subos/default/bin:$PATH"
70+
xlings install mcpp -y
71+
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
72+
73+
- name: mcpp build (self-host)
74+
run: mcpp build
75+
76+
- name: mcpp new hello → mcpp run
77+
run: |
78+
cd "$(mktemp -d)"
79+
mcpp new hello
80+
cd hello
81+
mcpp run
82+
83+
windows-fresh:
84+
name: Windows fresh install
85+
runs-on: windows-latest
86+
timeout-minutes: 30
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Install xlings + mcpp
91+
shell: pwsh
92+
env:
93+
XLINGS_NON_INTERACTIVE: '1'
94+
run: |
95+
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"
96+
Expand-Archive -Path "$env:TEMP\xlings.zip" -DestinationPath "$env:TEMP\xlings-extract" -Force
97+
& "$env:TEMP\xlings-extract\xlings-0.4.30-windows-x86_64\subos\default\bin\xlings.exe" self install
98+
$xlingsbin = "$env:USERPROFILE\.xlings\subos\default\bin"
99+
$env:PATH = "$xlingsbin;$env:PATH"
100+
xlings install mcpp -y
101+
$xlingsbin | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
102+
103+
- name: mcpp build (self-host)
104+
shell: pwsh
105+
run: mcpp build
106+
107+
- name: mcpp new hello → mcpp run
108+
shell: pwsh
109+
run: |
110+
$tmp = New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ }
111+
Set-Location $tmp
112+
mcpp new hello
113+
Set-Location hello
114+
mcpp run

0 commit comments

Comments
 (0)