Files
clice/.github/workflows/xmake.yml
2025-01-24 15:08:55 +08:00

82 lines
2.2 KiB
YAML

name: xmake
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths-ignore:
- '.clang-format'
- '.clangd'
- '.gitignore'
- 'LICENSE'
- 'README.md'
- '.github/workflows/cmake.yml'
jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04, windows-2022]
build_type: [release, debug]
runs-on: ${{ matrix.os }}
steps:
- name: Setup llvm
if: matrix.os == 'windows-2022'
uses: MinoruSekine/setup-scoop@v4.0.1
with:
buckets: main
apps: llvm
- name: Setup llvm & libstdc++ & cmake & ninja
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
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
if: matrix.os == 'ubuntu-24.04'
run: |
xmake config --yes --mode=${{ matrix.build_type }} --toolchain=clang-20
- name: Xmake configure
if: matrix.os == 'windows-2022'
run: |
xmake config --yes --toolchain=clang
- name: Build clice
run: |
xmake build --verbose --diagnosis --all
- name: Run tests
run: xmake test --verbose