Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 18 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,32 @@ name: CI

on:
push:
branches: [main, master]
branches: [main]
pull_request:
branches: [main, master]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
# Pin xlings bootstrap to the version we develop libxpkg against. Bumping
# together with code changes that depend on the new release. Without a
# pin, quick_install.sh follows latest — fine in steady state, risky when
# an in-flight xlings release breaks something we use.
XLINGS_VERSION: v0.4.13

jobs:
build-linux:
build:
name: build + test (linux x86_64, mcpp)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential

- name: Install Xlings (pinned ${{ env.XLINGS_VERSION }})
- name: Install xlings
env:
XLINGS_NON_INTERACTIVE: 1
XLINGS_VERSION: ${{ env.XLINGS_VERSION }}
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 Project Dependencies by Xlings
run: |
xlings install
xmake --version
gcc --version
g++ --version
cc --version

- name: Build
run: |
xmake f -m release -y -vv -cD
xmake -y -vv -j$(nproc)

- name: Test
XLINGS_VERSION: 0.4.25
run: |
xmake run xpkg_model_test
xmake run xpkg_index_test
xmake run xpkg_loader_test
xmake run xpkg_executor_test
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"

- name: Run examples
run: xmake run basic
- name: Install workspace tools (.xlings.json → mcpp 0.0.3)
run: xlings install -y

build-macos:
runs-on: macos-14
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: brew install xmake llvm@20

- 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)

build-windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- 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: Build
run: |
xmake f -m release -y -vv
xmake -y -vv -j$env:NUMBER_OF_PROCESSORS

- name: Test
run: |
xmake run xpkg_model_test
xmake run xpkg_index_test
xmake run xpkg_loader_test
xmake run xpkg_executor_test
- name: Build with mcpp
run: mcpp build

- name: Run examples
run: xmake run basic
- name: Run tests (skip ExecutorTest.ApplyElfpatchAuto_* — needs patchelf/install_name_tool which the runner doesn't ship)
run: mcpp test -- --gtest_filter=-ExecutorTest.ApplyElfpatchAuto_*
9 changes: 2 additions & 7 deletions .xlings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"workspace": {
"xmake": "3.0.7",
"cmake": "4.0.2",
"ninja": "1.12.1",

"gcc": { "linux": "15.1.0" },
"llvm": { "macosx": "20" }
"mcpp": { "linux": "0.0.3" }
}
}
}
6 changes: 0 additions & 6 deletions tests/main.cpp

This file was deleted.

Loading