154 lines
3.9 KiB
YAML
154 lines
3.9 KiB
YAML
name: xmake
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- ".github/workflows/xmake.yml"
|
|
- "include/**"
|
|
- "src/**"
|
|
- "tests/**"
|
|
- "xmake.lua"
|
|
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- ".github/workflows/xmake.yml"
|
|
- "include/**"
|
|
- "src/**"
|
|
- "tests/**"
|
|
- "xmake.lua"
|
|
|
|
jobs:
|
|
linux:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-24.04]
|
|
build_type: [release, debug]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Setup llvm & libstdc++ & cmake & ninja
|
|
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: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup xmake
|
|
uses: xmake-io/github-action-setup-xmake@v1
|
|
with:
|
|
xmake-version: branch@master
|
|
actions-cache-folder: ".xmake-cache"
|
|
actions-cache-key: ${{ matrix.os }}
|
|
package-cache: true
|
|
package-cache-key: ${{ matrix.os }}
|
|
build-cache: true
|
|
build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }}
|
|
|
|
- name: Xmake configure
|
|
run: |
|
|
xmake config --yes --mode=${{ matrix.build_type }} --toolchain=clang-20
|
|
|
|
- name: Build clice
|
|
run: |
|
|
xmake build --verbose --diagnosis --all
|
|
|
|
- name: Install uv for integration tests
|
|
uses: astral-sh/setup-uv@v6
|
|
|
|
- name: Run tests
|
|
run: xmake test --verbose
|
|
|
|
windows:
|
|
strategy:
|
|
matrix:
|
|
os: [windows-2025]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup xmake
|
|
uses: xmake-io/github-action-setup-xmake@v1
|
|
with:
|
|
xmake-version: branch@master
|
|
actions-cache-folder: ".xmake-cache"
|
|
actions-cache-key: ${{ matrix.os }}
|
|
package-cache: true
|
|
package-cache-key: ${{ matrix.os }}
|
|
build-cache: true
|
|
build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }}
|
|
|
|
- name: Xmake configure
|
|
run: |
|
|
xmake config --yes --toolchain=clang
|
|
|
|
- name: Build clice
|
|
run: |
|
|
xmake build --verbose --diagnosis --all
|
|
|
|
- name: Install uv for integration tests
|
|
uses: astral-sh/setup-uv@v6
|
|
|
|
- name: Run tests
|
|
run: xmake test --verbose
|
|
|
|
macos:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-15]
|
|
build_type: [release, debug]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup llvm
|
|
run: |
|
|
brew install llvm@20
|
|
|
|
- name: Setup xmake
|
|
uses: xmake-io/github-action-setup-xmake@v1
|
|
with:
|
|
xmake-version: branch@master
|
|
actions-cache-folder: ".xmake-cache"
|
|
actions-cache-key: ${{ matrix.os }}
|
|
package-cache: true
|
|
package-cache-key: ${{ matrix.os }}
|
|
build-cache: true
|
|
build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }}
|
|
|
|
- name: Xmake configure
|
|
run: |
|
|
xmake config --yes --ci=y --mode=${{ matrix.build_type }} --toolchain=clang --sdk=/opt/homebrew/opt/llvm@20
|
|
|
|
- name: Build clice
|
|
run: |
|
|
xmake build --verbose --diagnosis --all
|
|
|
|
- name: Install uv for integration tests
|
|
uses: astral-sh/setup-uv@v6
|
|
|
|
- name: Run tests
|
|
run: |
|
|
# Workaround for MacOS
|
|
export PATH="/opt/homebrew/opt/llvm@20/bin:/opt/homebrew/opt/lld@20/bin:$PATH"
|
|
xmake test --verbose
|