-
Notifications
You must be signed in to change notification settings - Fork 12
73 lines (63 loc) · 2.08 KB
/
osx.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
name: OSX
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -e -l {0}
jobs:
build:
runs-on: macos-${{ matrix.os }}
name: ${{ matrix.os }} / ${{ matrix.config.name }} / ${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
os:
- 13
- 14
config:
- { name: Debug }
- { name: Release }
compiler:
# - clang # TODO: Uncomment this line when we have fixed the compilation issue
- apple-clang
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add specification of clang++ in the conda environment specification
if: matrix.compiler == 'clang'
run: |
echo " - clangxx==17.0.6" >> environment-dev.yml
- name: Set conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-name: myenv
environment-file: environment-dev.yml
init-shell: bash
cache-downloads: true
- name: Use clang++ from conda-forge
if: matrix.compiler == 'clang'
run: |
echo "CXX=$CONDA_PREFIX/bin/clang++" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER=$CONDA_PREFIX/bin/clang++" >> $GITHUB_ENV
- name: Use Apple Clang (i.e. clang++ from Xcode)
if: matrix.compiler == 'apple-clang'
run: |
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER=/usr/bin/clang++" >> $GITHUB_ENV
- name: Configure using CMake
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=${{matrix.config.name}} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON
- name: Install
working-directory: build
run: cmake --install . --config ${{matrix.config.name}}
- name: Build
working-directory: build
run: cmake --build . --config ${{matrix.config.name}} --target test_sparrow_lib --parallel 8
- name: Run tests
working-directory: build
run: ctest -C ${{matrix.config.name}} --output-on-failure