74 lines (58 loc) · 1.87 KB
/
ci.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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
standard:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
include:
- runs-on: ubuntu-latest
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1
- runs-on: macos-latest
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_ALL=1
- runs-on: windows-latest
config: -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=1 -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
defaults:
run:
shell: bash -e -l {0}
name: ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
steps:
- name: Clone this library
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create conda environment
uses: mamba-org/setup-micromamba@main
with:
environment-file: environment.yaml
environment-name: myenv
init-shell: bash
cache-downloads: true
create-args: >-
${{ runner.os == 'Windows' && 'clang_win-64' || '' }}
- name: Export version of this library
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$LATEST_TAG" >> $GITHUB_ENV
- name: Configure using CMake
run: cmake -Bbuild ${{ matrix.config }}
- name: Build doxygen-docs
if: runner.os == 'Linux'
working-directory: build
run: make html
- name: Build C++
working-directory: build
run: cmake --build .
- name: Run C++
working-directory: build
run: ctest --output-on-failure
- name: Build and install Python module
run: SKBUILD_CONFIGURE_OPTIONS="-DUSE_DEBUG=1" python -m pip install . -v --no-build-isolation
- name: Run Python tests
run: python -m unittest discover tests