-
Notifications
You must be signed in to change notification settings - Fork 9
92 lines (78 loc) · 2.51 KB
/
debug.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
name: Debug
on:
push:
branches:
- master
pull_request:
env:
BUILD_TYPE: Debug
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "macOS 13 AppleClang 14 [Debug]",
os: macos-13,
cxx: "clang++"
}
- {
name: "macOS 13 GCC 12 [Debug]",
os: macos-13,
cxx: "g++-12"
}
- {
name: "Ubuntu 22.04 Clang 15 [Debug]",
os: ubuntu-22.04,
cxx: "clang++-15"
}
- {
name: "Ubuntu 22.04 GCC 12 [Debug]",
os: ubuntu-22.04,
cxx: "g++-12"
}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Get macOS Concurrency
if: runner.os == 'macOS'
run: |
echo NPROC="sysctl -n hw.ncpu" >> $GITHUB_ENV
echo "Running on $(sysctl -n hw.ncpu) threads ..."
- name: Get Linux Concurrency
if: runner.os == 'Linux'
run: |
echo NPROC="nproc" >> $GITHUB_ENV
echo "Running on $(nproc) threads ..."
- name: Set Up macOS Dependencies
if: runner.os == 'macOS'
run: |
brew install ninja gcc@12 mpfr cairo gnuplot pkg-config
python3 -m pip install --upgrade pip
pip3 install --upgrade pip
pip3 install pytest
- name: Set Up Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt install -y cmake ninja-build pkg-config clang-15 g++-12 libcairo2-dev gnuplot libmpfr-dev python3-pip python3.11-dev
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
sudo pip3 install pytest
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}} -G "Ninja" -DWERROR=ON
- name: Build Library and Bindings
working-directory: ${{runner.workspace}}/build
run: cmake --build . --parallel $($NPROC)
- name: Build Tests
working-directory: ${{runner.workspace}}/build
run: cmake --build . --parallel $($NPROC) --target tests
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -j $($NPROC) --output-on-failure