@@ -85,34 +85,38 @@ jobs:
8585 steps :
8686 - uses : actions/checkout@v4
8787 - uses : ./.github/actions/setup-toolchain
88- with :
89- token : ${{ github.token }}
9088
9189 - name : Configure (linux)
9290 if : runner.os == 'Linux'
9391 working-directory : tests
9492 run : |
95- # gcc 15 installed by xlings — put its bin dir first so xmake finds it
9693 GCC_VERSION=$(python3 -c "import json; d=json.load(open('../.xlings.json')); print(d['workspace']['gcc']['linux'])")
97- export PATH="$HOME/.xlings/data/xpkgs/xim-x-gcc/${GCC_VERSION}/bin:$HOME/.xlings/bin:$HOME/.xlings/subos/current/bin:$PATH"
98- echo "gcc version: $(gcc --version | head -1)"
99- xmake f -P . -y -vv
94+ GCC_SDK="$HOME/.xlings/data/xpkgs/xim-x-gcc/${GCC_VERSION}"
95+ echo "Using gcc ${GCC_VERSION} from ${GCC_SDK}"
96+ "${GCC_SDK}/bin/gcc" --version | head -1
97+ xmake f -P . -y -vv \
98+ --sdk="${GCC_SDK}" \
99+ --cc="${GCC_SDK}/bin/gcc" \
100+ --cxx="${GCC_SDK}/bin/g++"
100101
101102 - name : Configure (macos)
102103 if : runner.os == 'macOS'
103104 working-directory : tests
104105 run : |
105106 LLVM_VERSION=$(python3 -c "import json; d=json.load(open('../.xlings.json')); print(d['workspace']['llvm']['macosx'])")
106- export PATH="$HOME/.xlings/data/xpkgs/xim-x-llvm/${LLVM_VERSION}/bin:$HOME/.xlings/bin:$HOME/.xlings/subos/current/bin:$PATH"
107- echo "clang version: $(clang --version | head -1)"
108- xmake f -P . -y --toolchain=llvm -vv
107+ LLVM_SDK="$HOME/.xlings/data/xpkgs/xim-x-llvm/${LLVM_VERSION}"
108+ echo "Using llvm ${LLVM_VERSION} from ${LLVM_SDK}"
109+ "${LLVM_SDK}/bin/clang" --version | head -1
110+ xmake f -P . -y -vv \
111+ --toolchain=llvm \
112+ --sdk="${LLVM_SDK}" \
113+ --cc="${LLVM_SDK}/bin/clang" \
114+ --cxx="${LLVM_SDK}/bin/clang++"
109115
110116 - name : Configure (windows)
111117 if : runner.os == 'Windows'
112118 working-directory : tests
113- run : |
114- $env:PATH = "$env:USERPROFILE\.xlings\bin;$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
115- xmake f -P . -y -vv
119+ run : xmake f -P . -y -vv
116120
117121 - name : Build and test (unix)
118122 if : runner.os != 'Windows'
@@ -121,26 +125,23 @@ jobs:
121125 BUILD_ALL : ${{ needs.detect-changes.outputs.build_all }}
122126 CHANGED_PACKAGES : ${{ needs.detect-changes.outputs.packages }}
123127 run : |
124- # Set up PATH with correct compiler version
128+ # Put correct compiler on PATH for xmake build subprocesses
125129 if [ "$(uname)" = "Linux" ]; then
126130 GCC_VERSION=$(python3 -c "import json; d=json.load(open('../.xlings.json')); print(d['workspace']['gcc']['linux'])")
127- export PATH="$HOME/.xlings/data/xpkgs/xim-x-gcc/${GCC_VERSION}/bin:$HOME/.xlings/bin:$HOME/.xlings/subos/current/bin:$ PATH"
131+ export PATH="$HOME/.xlings/data/xpkgs/xim-x-gcc/${GCC_VERSION}/bin:$PATH"
128132 else
129133 LLVM_VERSION=$(python3 -c "import json; d=json.load(open('../.xlings.json')); print(d['workspace']['llvm']['macosx'])")
130- export PATH="$HOME/.xlings/data/xpkgs/xim-x-llvm/${LLVM_VERSION}/bin:$HOME/.xlings/bin:$HOME/.xlings/subos/current/bin:$ PATH"
134+ export PATH="$HOME/.xlings/data/xpkgs/xim-x-llvm/${LLVM_VERSION}/bin:$PATH"
131135 fi
132136
133137 # Collect test targets to build
134138 TARGETS=""
135139 if [ "$BUILD_ALL" = "true" ]; then
136- # Find all test targets from test xmake.lua files
137140 TARGETS=$(grep -r 'target("' */*/xmake.lua 2>/dev/null | sed 's/.*target("\([^"]*\)").*/\1/' | sort -u)
138141 echo "Building ALL targets: $TARGETS"
139142 else
140- # Build only changed packages
141143 for pkg in $(echo "$CHANGED_PACKAGES" | tr -d '[]"' | tr ',' ' '); do
142144 TARGET="${pkg}_test"
143- # Verify the target exists
144145 if grep -rq "target(\"$TARGET\")" */*/xmake.lua 2>/dev/null; then
145146 TARGETS="$TARGETS $TARGET"
146147 else
@@ -176,8 +177,6 @@ jobs:
176177 BUILD_ALL : ${{ needs.detect-changes.outputs.build_all }}
177178 CHANGED_PACKAGES : ${{ needs.detect-changes.outputs.packages }}
178179 run : |
179- $env:PATH = "$env:USERPROFILE\.xlings\bin;$env:USERPROFILE\.xlings\subos\current\bin;$env:PATH"
180-
181180 # Collect test targets
182181 $targets = @()
183182 if ($env:BUILD_ALL -eq "true") {
0 commit comments