-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (93 loc) · 2.72 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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