From 801933f94a70e6c8263ea83e7e80431786e059c2 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sat, 14 Mar 2026 00:39:41 +0800 Subject: [PATCH 1/6] ci test --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80d23cf..b4ca450 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,9 @@ jobs: - name: Install GCC 15.1 with Xlings run: | xlings install gcc@15.1 -y + ls -al $HOME/.xlings/subos/current/bin/cc + cat $HOME/.xlings/.xlings.json + cc --version - name: Build run: | From 67c2705a85a29d0abfd97c5e5941eeb82b0d7b0a Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sun, 15 Mar 2026 13:14:39 +0800 Subject: [PATCH 2/6] update xlings config file --- .github/workflows/ci.yml | 12 +++--------- .xlings.json | 9 +++++++++ config.xlings | 9 --------- 3 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 .xlings.json delete mode 100644 config.xlings diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ca450..e50326c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: latest - package-cache: true - - name: Install dependencies run: | sudo apt-get update @@ -42,9 +36,9 @@ jobs: - name: Install GCC 15.1 with Xlings run: | - xlings install gcc@15.1 -y - ls -al $HOME/.xlings/subos/current/bin/cc - cat $HOME/.xlings/.xlings.json + xlings install --verbose + xmake --version + gcc --version cc --version - name: Build diff --git a/.xlings.json b/.xlings.json new file mode 100644 index 0000000..c14ca35 --- /dev/null +++ b/.xlings.json @@ -0,0 +1,9 @@ +{ + "workspace": { + "cmake": "4.0.2", + "ninja": "1.12.1", + "xmake": "3.0.7", + "gcc": { "linux": "15.1.0" }, + "llvm": { "macosx": "20" } + } +} \ No newline at end of file diff --git a/config.xlings b/config.xlings deleted file mode 100644 index db3c96c..0000000 --- a/config.xlings +++ /dev/null @@ -1,9 +0,0 @@ -xname = "mcpplibs-templates" - --- install by `xlings install` -xim = { - xmake = "3.0.4", - cmake = "4.0.2", - ninja = "1.12.1", - cpp = "", -- gcc15 or mingw13 -} \ No newline at end of file From 99d0016851cb5c0f38e9715b8acfd8df2a74cbcb Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 16 Mar 2026 05:39:33 +0800 Subject: [PATCH 3/6] use xlings to auto-config project --- .github/workflows/ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e50326c..e712f8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,20 +53,28 @@ jobs: run: xmake run basic build-macos: - runs-on: macos-14 + runs-on: macos-15 timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@v4 - - name: Install dependencies - run: brew install xmake llvm@20 + - name: Install Xlings + env: + XLINGS_NON_INTERACTIVE: 1 + run: | + curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.sh | bash + echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV" + + - name: Install LLVM 20 with Xlings + run: | + xlings install --verbose + xmake --version + clang --version - name: Build run: | - export PATH=/opt/homebrew/opt/llvm@20/bin:$PATH - xmake f --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20 -m release -y -vv - xmake -y -vv -j$(sysctl -n hw.ncpu) + xmake f -m release --toolchain=llvm -y -vv build-windows: runs-on: windows-latest From 04b7b5cce84a9eae5e78d118b1047c3f2311a439 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 16 Mar 2026 05:42:31 +0800 Subject: [PATCH 4/6] update macos ci --- .github/workflows/ci.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e712f8b..94cedc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ concurrency: group: ci-${{ github.ref }} cancel-in-progress: true +env: + XLINGS_VERSION: v0.4.2 + jobs: build-linux: runs-on: ubuntu-latest @@ -54,27 +57,33 @@ jobs: build-macos: runs-on: macos-15 - timeout-minutes: 20 steps: - - name: Checkout + - name: Checkout code uses: actions/checkout@v4 - name: Install Xlings env: XLINGS_NON_INTERACTIVE: 1 run: | - curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.sh | bash + VERSION_NUM="${XLINGS_VERSION#v}" + TARBALL="xlings-${VERSION_NUM}-macosx-arm64.tar.gz" + curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}" + tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP" + EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1) + xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true + chmod +x "$EXTRACT_DIR/bin/xlings" + "$EXTRACT_DIR/bin/xlings" self install echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV" - - name: Install LLVM 20 with Xlings + - name: Install Project Dependencies via Xlings run: | - xlings install --verbose - xmake --version + xlings install clang --version - - name: Build + - name: Build with xmake run: | - xmake f -m release --toolchain=llvm -y -vv + xmake f -m release --toolchain=llvm -vv -y + xmake -j$(nproc) build-windows: runs-on: windows-latest From 2a056f1cc25f2312c30ae41f525d470fee3768dc Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 16 Mar 2026 05:48:48 +0800 Subject: [PATCH 5/6] fix(build): align xmake build patterns and CI test command - https://github.com/mcpplibs/primitives/pull/2 - https://github.com/yizhinailong Signed-off-by: sunrisepeak --- .github/workflows/ci.yml | 4 ++-- tests/xmake.lua | 2 +- xmake.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94cedc0..ccb7339 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: xmake -y -vv -j$(nproc) - name: Test - run: xmake run templates_test + run: xmake run primitives_test - name: Run examples run: xmake run basic @@ -104,7 +104,7 @@ jobs: xmake -y -vv -j$env:NUMBER_OF_PROCESSORS - name: Test - run: xmake run templates_test + run: xmake run primitives_test - name: Run examples run: xmake run basic diff --git a/tests/xmake.lua b/tests/xmake.lua index d113570..fd1d671 100644 --- a/tests/xmake.lua +++ b/tests/xmake.lua @@ -6,7 +6,7 @@ add_requires("gtest") target("primitives_test") set_kind("binary") - add_files("*.cpp") + add_files("basic/*.cpp") add_deps("mcpplibs-primitives") add_packages("gtest") set_policy("build.c++.modules", true) diff --git a/xmake.lua b/xmake.lua index 31afa35..3b780dc 100644 --- a/xmake.lua +++ b/xmake.lua @@ -4,7 +4,7 @@ set_languages("c++23") target("mcpplibs-primitives") set_kind("static") - add_files("src/*.cppm", { public = true, install = true }) + add_files("src/**.cppm", { public = true, install = true }) set_policy("build.c++.modules", true) if not is_host("macosx") then From e17d81c8f82999dbd5ffefef59eb7cd3bafc0c35 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Mon, 16 Mar 2026 06:01:51 +0800 Subject: [PATCH 6/6] update macos ci --- .github/workflows/ci.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccb7339..fda6702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,22 +57,16 @@ jobs: build-macos: runs-on: macos-15 + timeout-minutes: 20 steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v4 - name: Install Xlings env: XLINGS_NON_INTERACTIVE: 1 run: | - VERSION_NUM="${XLINGS_VERSION#v}" - TARBALL="xlings-${VERSION_NUM}-macosx-arm64.tar.gz" - curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}" - tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP" - EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1) - xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true - chmod +x "$EXTRACT_DIR/bin/xlings" - "$EXTRACT_DIR/bin/xlings" self install + curl -fsSL https://d2learn.org/xlings-install.sh | bash echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV" - name: Install Project Dependencies via Xlings