142 lines
3.6 KiB
YAML
142 lines
3.6 KiB
YAML
name: xmake
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths-ignore:
|
|
- 'docs'
|
|
- 'scripts'
|
|
- '.clang-format'
|
|
- '.clangd'
|
|
- '.gitignore'
|
|
- 'LICENSE'
|
|
- 'README.md'
|
|
- '.github/workflows/cmake.yml'
|
|
- 'CMakeLists.txt'
|
|
- 'CMakePresets.json'
|
|
- 'cmake'
|
|
|
|
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: 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: 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 --mode=${{ matrix.build_type }} --toolchain=clang --sdk=/opt/homebrew/opt/llvm@20
|
|
|
|
- name: Build clice
|
|
run: |
|
|
xmake build --verbose --diagnosis --all
|
|
|
|
- name: Run tests
|
|
run: |
|
|
xmake test --verbose
|