Skip to content

fix: install -g writes versions/workspace to global scope #571

fix: install -g writes versions/workspace to global scope

fix: install -g writes versions/workspace to global scope #571

Workflow file for this run

name: xlings-ci-linux
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
GIT_TERMINAL_PROMPT: 0
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
# ── Phase 1: Configure Environment ──────────────────────────
- name: Install system deps
run: |
sudo apt-get update -qq
sudo apt-get install -y curl git build-essential
- name: Install xmake (bundled v3.0.7)
run: |
XMAKE_URL="https://github.com/xmake-io/xmake/releases/download/v3.0.7/xmake-bundle-v3.0.7.linux.x86_64"
curl -fsSL -o xmake.bin "$XMAKE_URL" -H "Accept: application/octet-stream"
chmod +x xmake.bin
mkdir -p xmake/bin
mv xmake.bin xmake/bin/xmake
echo "PATH=$GITHUB_WORKSPACE/xmake/bin:$PATH" >> "$GITHUB_ENV"
export PATH="$GITHUB_WORKSPACE/xmake/bin:$PATH"
xmake --version
- name: Install Xlings
env:
XLINGS_NON_INTERACTIVE: 1
run: |
curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/main/tools/other/quick_install.sh | bash
echo "XLINGS_HOME=$HOME/.xlings" >> "$GITHUB_ENV"
echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
- name: Install musl-gcc 15.1
run: |
MUSL_SDK=$HOME/.xlings/data/xpkgs/musl-gcc/15.1.0
mkdir -p "$MUSL_SDK"
curl -fSL# https://github.com/xlings-res/musl-gcc/releases/download/15.1.0/musl-gcc-15.1.0-linux-x86_64.tar.gz | tar xz -C "$MUSL_SDK" --strip-components=1
echo "MUSL_SDK=$MUSL_SDK" >> "$GITHUB_ENV"
echo "CC=x86_64-linux-musl-gcc" >> "$GITHUB_ENV"
echo "CXX=x86_64-linux-musl-g++" >> "$GITHUB_ENV"
echo "PATH=$MUSL_SDK/bin:$PATH" >> "$GITHUB_ENV"
export PATH="$MUSL_SDK/bin:$PATH"
test -f "$MUSL_SDK/x86_64-linux-musl/include/c++/15.1.0/bits/std.cc"
x86_64-linux-musl-g++ --version
bash tools/setup_musl_runtime.sh "$MUSL_SDK"
- name: Prepare fixture index repo
run: |
bash tests/e2e/prepare_fixture_index.sh
- name: Configure xmake
run: |
xmake f -c -p linux -m release --sdk="$MUSL_SDK" --cross=x86_64-linux-musl- --cc="$CC" --cxx="$CXX" -y
# ── Phase 1.5: Unit Tests ────────────────────────────────────
- name: Build and run unit tests
run: |
xmake build xlings_tests
xmake run xlings_tests
# ── Phase 2: Build via Release Script ───────────────────────
- name: Build (linux_release)
run: |
chmod +x ./tools/linux_release.sh
SKIP_NETWORK_VERIFY=1 ./tools/linux_release.sh
- name: "E2E-01: Bootstrap Home (portable + installed)"
run: |
bash tests/e2e/bootstrap_home_test.sh
- name: Uninstall old Xlings
run: |
xlings self uninstall -y || rm -rf "$HOME/.xlings"
- name: Prepare release artifact
run: |
tarball=$(ls build/xlings-*-linux-x86_64.tar.gz 2>/dev/null | head -1)
[[ -z "$tarball" ]] && { echo "No release tarball found"; exit 1; }
cp "$tarball" build/release.tar.gz
- name: "E2E-02: Release Self Install"
run: |
bash tests/e2e/release_self_install_test.sh build/release.tar.gz
- name: "E2E-03: Quick Install Smoke"
continue-on-error: true # may fail due to GitHub rate limits
env:
XLINGS_NON_INTERACTIVE: 1
run: |
bash tests/e2e/release_quick_install_test.sh
- name: "E2E-04: Release Subos + d2x Reuse + RPATH"
run: |
bash tests/e2e/release_subos_smoke_test.sh build/release.tar.gz
- name: "E2E-05: Fixed Project Scenarios"
run: |
bash tests/e2e/project_e2e_test.sh
- name: "E2E-06: Sub-Index Search + pkgindex-build"
run: |
bash tests/e2e/sub_index_search_test.sh
- name: "E2E-07: Sub-Index Install (namespace + bare name)"
run: |
bash tests/e2e/sub_index_install_test.sh
- name: "E2E-08: Index Cache"
run: |
bash tests/e2e/index_cache_test.sh
- name: "E2E-09: Legacy config.xlings Compatibility"
run: |
bash tests/e2e/legacy_config_test.sh
- name: "E2E-10: linux-headers install (pkginfo.install_dir)"
run: |
bash tests/e2e/pkginfo_install_dir_test.sh
- name: "E2E-11: Script-type package install/export/uninstall"
run: |
bash tests/e2e/script_type_install_test.sh
- name: "E2E-12: Elfpatch install verify (d2x interpreter + rpath)"
run: |
bash tests/e2e/elfpatch_install_verify_test.sh build/release.tar.gz
- name: Attach artifact
uses: actions/upload-artifact@v4
if: success()
with:
name: xlings-linux-x86_64
path: build/release.tar.gz