-
Notifications
You must be signed in to change notification settings - Fork 736
72 lines (61 loc) · 1.72 KB
/
ci.yaml
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
name: Python CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ["3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive # This will clone the repository with all its submodules
fetch-depth: 0 # This fetches all history so you can access any version of the submodules
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build pytest
shell: bash
- name: Install CMake (if needed)
if: runner.os == 'macOS' || runner.os == 'Windows'
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' || exit 1
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install cmake
fi
shell: bash
- name: Build DLL (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install -e .
shell: bash
- name: Build (macOS)
if: runner.os == 'macOS'
run: |
CMAKE_ARGS="-DCMAKE_CXX_FLAGS=-fopenmp"
python -m pip install -e .
shell: bash
- name: Run tests
run: |
python -m pytest tests
shell: bash