Skip to content

Commit b8da7e7

Browse files
build: use pixi in ci (#325)
Co-authored-by: ykiko <ykikoykikoykiko@gmail.com>
1 parent 1da3457 commit b8da7e7

File tree

7 files changed

+838
-129
lines changed

7 files changed

+838
-129
lines changed

.github/workflows/build-llvm.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
include:
15-
# Windows
1615
- os: windows-2025
1716
llvm_mode: Debug
1817
lto: OFF
@@ -22,7 +21,7 @@ jobs:
2221
- os: windows-2025
2322
llvm_mode: RelWithDebInfo
2423
lto: ON
25-
# Linux
24+
2625
- os: ubuntu-24.04
2726
llvm_mode: Debug
2827
lto: OFF
@@ -32,7 +31,7 @@ jobs:
3231
- os: ubuntu-24.04
3332
llvm_mode: RelWithDebInfo
3433
lto: ON
35-
# macOS
34+
3635
- os: macos-15
3736
llvm_mode: Debug
3837
lto: OFF

.github/workflows/check-format.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717

18-
- name: Install uv
19-
uses: astral-sh/setup-uv@v6
18+
- name: Setup Pixi
19+
uses: prefix-dev/setup-pixi@v0.9.3
20+
with:
21+
pixi-version: v0.61.0
22+
environments: develop
23+
activate-environment: true
24+
cache: true
25+
locked: true
2026

2127
- name: Run check
2228
id: precommit
2329
run: |
24-
uv venv
25-
uv pip install pre-commit
26-
uv run pre-commit run --all-files
30+
pixi run ci-check
2731
continue-on-error: true
2832

2933
- name: Show diff on failure

.github/workflows/cmake.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,16 @@ jobs:
4242
- name: Setup Pixi
4343
uses: prefix-dev/setup-pixi@v0.9.3
4444
with:
45-
pixi-version: v0.59.0
45+
pixi-version: v0.61.0
4646
environments: develop
4747
activate-environment: true
4848
cache: true
4949
locked: true
5050

51-
- name: Build clice
52-
shell: bash
51+
- name: Build
5352
run: |
54-
cmake -B build -G Ninja \
55-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
56-
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
57-
-DCLICE_ENABLE_TEST=ON \
58-
-DCLICE_CI_ENVIRONMENT=ON
59-
cmake --build build
53+
pixi run ci-cmake-build ${{ matrix.build_type }}
6054
61-
- name: Run tests
62-
shell: bash
55+
- name: Test
6356
run: |
64-
EXE_EXT=""
65-
if [[ "${{ runner.os }}" == "Windows" ]]; then
66-
EXE_EXT=".exe"
67-
fi
68-
./build/bin/unit_tests${EXE_EXT} --test-dir="./tests/data"
69-
uv run --project tests pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice${EXE_EXT}
57+
pixi run ci-cmake-test

.github/workflows/xmake.yml

Lines changed: 18 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- "xmake.lua"
1212

1313
pull_request:
14-
branches: [main-test]
14+
branches: [main]
1515
paths:
1616
- ".github/workflows/xmake.yml"
1717
- "include/**"
@@ -34,68 +34,38 @@ jobs:
3434
runs-on: ${{ matrix.os }}
3535

3636
steps:
37-
- name: Setup dependencies (Linux)
38-
if: runner.os == 'Linux'
39-
run: |
40-
sudo apt update
41-
sudo apt install -y gcc-14 g++-14 libstdc++-14-dev
42-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
43-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
44-
sudo update-alternatives --set gcc /usr/bin/gcc-14
45-
sudo update-alternatives --set g++ /usr/bin/g++-14
46-
wget https://apt.llvm.org/llvm.sh
47-
chmod +x llvm.sh
48-
sudo ./llvm.sh 20 all
49-
sudo apt install -y cmake ninja-build
50-
51-
- name: Setup dependencies (MacOS)
52-
if: runner.os == 'macOS'
53-
env:
54-
HOMEBREW_NO_AUTO_UPDATE: 1
55-
run: |
56-
brew install llvm@20 lld@20
57-
5837
- name: Checkout repository
5938
uses: actions/checkout@v4
6039

6140
- name: Setup xmake
6241
uses: xmake-io/github-action-setup-xmake@v1
6342
with:
64-
xmake-version: 3.0.4
43+
xmake-version: 3.0.5
6544
actions-cache-folder: ".xmake-cache"
6645
actions-cache-key: ${{ matrix.os }}
6746
package-cache: true
68-
package-cache-key: ${{ matrix.os }}
47+
package-cache-key: ${{ matrix.os }}-pixi
6948
build-cache: true
7049
build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }}
7150

72-
- name: Build clice
73-
shell: bash
74-
run: |
75-
if [[ "${{ runner.os }}" == "Windows" ]]; then
76-
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang -p windows
77-
elif [[ "${{ runner.os }}" == "Linux" ]]; then
78-
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang-20
79-
elif [[ "${{ runner.os }}" == "macOS" ]]; then
80-
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
81-
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang --sdk=/opt/homebrew/opt/llvm@20
82-
fi
83-
84-
xmake build --verbose --diagnosis --all
85-
86-
- name: Install uv for integration tests
87-
uses: astral-sh/setup-uv@v6
51+
- name: Setup Pixi
52+
uses: prefix-dev/setup-pixi@v0.9.3
53+
with:
54+
pixi-version: v0.61.0
55+
environments: develop
56+
activate-environment: true
57+
cache: true
58+
locked: true
8859

89-
- name: Run tests
90-
shell: bash
60+
- name: Build
9161
run: |
92-
# Workaround for macOS
93-
if [[ "${{ runner.os }}" == "macOS" ]]; then
94-
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
95-
fi
62+
pixi run ci-xmake-build ${{ matrix.build_type }}
9663
97-
xmake test --verbose
64+
- name: Test
65+
run: |
66+
pixi run xmake-test
9867
68+
# Clean up llvm package to reduce cache size
9969
- name: Remove llvm package (Linux)
10070
if: runner.os == 'Linux'
101-
run: rm -rf /home/runner/.xmake/packages/c/clice-llvm
71+
run: xmake require --uninstall clice-llvm

0 commit comments

Comments
 (0)