From 6811d68313de388189bc1c1f5977284b2db28ff2 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 10 May 2026 04:06:28 +0800 Subject: [PATCH] ci: switch to mcpp build (.xlings.json pins mcpp 0.0.3) Replaces no-CI / leftover xmake-only CI with a mcpp-driven workflow: - `.xlings.json` declares `mcpp = { linux = "0.0.3" }` so xlings installs the right mcpp release on the runner. - `.github/workflows/ci.yml` boots xlings, runs `xlings install -y`, then `mcpp build` + `mcpp test` against the existing mcpp.toml. The xmake.lua stays for local / contributor flexibility, but CI is now mcpp-only on Linux. --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ .xlings.json | 5 +++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .xlings.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2ab74d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + build: + name: build + test (linux x86_64, mcpp) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Bootstrap xlings — the tool that the workspace's `.xlings.json` + # binds tool versions to (here it pins mcpp 0.0.3). + - name: Install xlings + env: + XLINGS_VERSION: 0.4.25 + run: | + tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz" + curl -fsSL -o "/tmp/${tarball}" \ + "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}" + tar -xzf "/tmp/${tarball}" -C /tmp + "/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" + + # Resolves `.xlings.json` → installs mcpp@0.0.3 (and any other + # workspace tools listed). Idempotent on cache hits. + - name: Install workspace tools (.xlings.json) + run: xlings install -y + + - name: Build with mcpp + run: mcpp build + + - name: Run tests + run: mcpp test diff --git a/.xlings.json b/.xlings.json new file mode 100644 index 0000000..f2be3fd --- /dev/null +++ b/.xlings.json @@ -0,0 +1,5 @@ +{ + "workspace": { + "mcpp": { "linux": "0.0.3" } + } +}