Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
14 changes: 9 additions & 5 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.61.0
environments: develop
activate-environment: true
cache: true
locked: true
Comment thread
star-hengxing marked this conversation as resolved.

- name: Run check
id: precommit
run: |
uv venv
uv pip install pre-commit
uv run pre-commit run --all-files
pixi run ci-check
continue-on-error: true
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Show diff on failure
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,16 @@ jobs:
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.59.0
pixi-version: v0.61.0
environments: develop
activate-environment: true
cache: true
locked: true

- name: Build clice
shell: bash
- name: Build
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \
-DCLICE_ENABLE_TEST=ON \
-DCLICE_CI_ENVIRONMENT=ON
cmake --build build
pixi run ci-cmake-build ${{ matrix.build_type }}

- name: Run tests
shell: bash
- name: Test
run: |
EXE_EXT=""
if [[ "${{ runner.os }}" == "Windows" ]]; then
EXE_EXT=".exe"
fi
./build/bin/unit_tests${EXE_EXT} --test-dir="./tests/data"
uv run --project tests pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice${EXE_EXT}
pixi run ci-cmake-test
63 changes: 16 additions & 47 deletions .github/workflows/xmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- "xmake.lua"

pull_request:
branches: [main-test]
branches: [main]
paths:
- ".github/workflows/xmake.yml"
- "include/**"
Expand All @@ -34,27 +34,6 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Setup dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y gcc-14 g++-14 libstdc++-14-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
sudo update-alternatives --set gcc /usr/bin/gcc-14
sudo update-alternatives --set g++ /usr/bin/g++-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20 all
sudo apt install -y cmake ninja-build

- name: Setup dependencies (MacOS)
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
brew install llvm@20 lld@20

- name: Checkout repository
uses: actions/checkout@v4

Expand All @@ -65,37 +44,27 @@ jobs:
actions-cache-folder: ".xmake-cache"
actions-cache-key: ${{ matrix.os }}
package-cache: true
package-cache-key: ${{ matrix.os }}
package-cache-key: ${{ matrix.os }}-pixi
build-cache: true
build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }}

- name: Build clice
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang -p windows
elif [[ "${{ runner.os }}" == "Linux" ]]; then
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang-20
elif [[ "${{ runner.os }}" == "macOS" ]]; then
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang --sdk=/opt/homebrew/opt/llvm@20
fi

xmake build --verbose --diagnosis --all

- name: Install uv for integration tests
uses: astral-sh/setup-uv@v6
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.61.0
environments: develop
activate-environment: true
cache: true
locked: true

- name: Run tests
shell: bash
- name: Build
run: |
# Workaround for macOS
if [[ "${{ runner.os }}" == "macOS" ]]; then
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
fi
pixi run ci-xmake-build ${{ matrix.build_type }}

xmake test --verbose
- name: Test
run: |
pixi run xmake-test

- name: Remove llvm package (Linux)
if: runner.os == 'Linux'
run: rm -rf /home/runner/.xmake/packages/c/clice-llvm
run: xmake require --uninstall clice-llvm
Loading
Loading