[brief] Fixing the CI script again. #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- 'LICENSE' | |
- 'data/**' | |
- '**/release-*.yml' | |
tags-ignore: | |
- "*.*.*" | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
- 'LICENSE' | |
- '**/release-*.yml' | |
tags-ignore: | |
- "*.*.*" | |
workflow_dispatch: | |
jobs: | |
format: | |
uses: ./.github/workflows/clang-format.yml | |
build: | |
name: ${{ matrix.config.os }}-${{ matrix.config.preset }} | |
runs-on: ${{ matrix.config.os }} | |
needs: format | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: "windows-latest", cxx: "msvc", cc: "msvc", preset: "msvc"} | |
- {os: "ubuntu-24.04", cxx: "clang++-18", cc: "clang-18", preset: "clang"} | |
- {os: "ubuntu-24.04", cxx: "gcc-14", cc: "gcc-14", preset: "gcc"} | |
build: ["Debug", "Release"] | |
steps: | |
- name: Chekout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
id: setup_python | |
with: | |
python-version: "3.12" | |
- name: Cache dependencies | |
id: cache-deps | |
uses: actions/cache@v4 | |
with: | |
path: ~/deps | |
key: deps_${{ matrix.config.os }}_${{ matrix.build }}_${{ hashfiles('dependencies.txt') }} | |
- name: Install dependencies | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
shell: bash | |
env: | |
CC: ${{ matrix.config.cc }} | |
CXX: ${{ matrix.config.cxx }} | |
BUILD_TYPE: ${{ matrix.build }} | |
run: | | |
if [[ "$OSTYPE" == "msys" ]]; then | |
python tools/build_dependencies.py ~/deps $BUILD_TYPE | |
else | |
python3 tools/build_dependencies.py ~/deps $BUILD_TYPE | |
fi | |
- name: Build Zeus | |
shell: bash | |
env: | |
BUILD_TYPE: ${{ matrix.build }} | |
CONFIG_TYPE: ${{ matrix.config.preset }} | |
CC: ${{ matrix.config.cc }} | |
CXX: ${{ matrix.config.cxx }} | |
run: | | |
cmake --preset=$CONFIG_TYPE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH=~/deps | |
cd ./build | |
if [[ "$OSTYPE" == "msys" ]]; then | |
cmake --build . --config $BUILD_TYPE | |
else | |
make | |
fi | |
- name: Run tests | |
shell: bash | |
working-directory: ./build | |
env: | |
BUILD_TYPE: ${{ matrix.build }} | |
CONFIG_TYPE: ${{ matrix.config.preset }} | |
CC: ${{ matrix.config.cc }} | |
CXX: ${{ matrix.config.cxx }} | |
run: | | |
if [[ "$OSTYPE" == "msys" ]]; then | |
cmake --build . --target RUN_TESTS --config $BUILD_TYPE | |
else | |
make test | |
fi |