-
Notifications
You must be signed in to change notification settings - Fork 6
93 lines (79 loc) · 2.53 KB
/
ci.yml
File metadata and controls
93 lines (79 loc) · 2.53 KB
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
name: CI
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 3
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- "3.8"
- "3.12"
defaults:
run:
shell: bash -el {0}
env:
NINJA_STATUS: "[Built edge %f of %t in %e sec] "
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # such that setuptools_scm can do its job correctly
# this will set the system compiler;
# This must be done *before* setting up miniconda, see:
# https://github.com/ilammy/msvc-dev-cmd/issues/34
- name: Set Windows env
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
env:
KMP_DUPLICATE_LIB_OK: "TRUE"
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if .github/environment.yml has not changed
CACHE_NUMBER: 2
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/environment.yml') }}
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
auto-activate-base: false
channels: conda-forge
channel-priority: true
activate-environment: cppe-gha
environment-file: .github/environment.yml
- name: Select CMake CLI options
run: |
echo "We are running on ${{ matrix.os }}"
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
echo "SKBUILD_CMAKE_ARGS=-DCMAKE_CXX_COMPILER=g++;-GNinja" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
echo "SKBUILD_CMAKE_ARGS=-DCMAKE_CXX_COMPILER=clang++;-GNinja" >> $GITHUB_ENV
else
echo "SKBUILD_CMAKE_ARGS=-DCMAKE_CXX_COMPILER=clang-cl;-GNinja" >> $GITHUB_ENV
fi
- name: Configure, build, install
run: |
python -m pip install -v .[test]
- name: Test
run: |
python -m pytest -vvv --ignore=tests/test_fields.py --ignore=tests/test_functionality.py --ignore=tests/test_gradients.py --ignore=tests/test_solver.py