-
Notifications
You must be signed in to change notification settings - Fork 13
108 lines (91 loc) · 3.3 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: batoid CI
on:
push:
branches:
- main
- releases/*
pull_request:
branches:
- main
- releases/*
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
py: [3.8, 3.9, '3.10', 3.11, 3.12]
CC: [ gcc ]
CXX: [ g++ ]
include:
- os: macos-latest
py: 3.8
CC: cc
CXX: c++
- os: ubuntu-latest
py: 3.8
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Print github context properties
run: |
echo 'event: ${{ github.event_name }}'
echo 'sha: ${{ github.sha }}'
echo 'ref: ${{ github.ref }}'
echo 'head_ref: ${{ github.head_ref }}'
echo 'base_ref: ${{ github.base_ref }}'
echo 'event.before: ${{ github.event.before }}'
echo 'event.after: ${{ github.event.after }}'
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Install libfftw, etc. on linux (needed for GalSim)
if: matrix.os == 'ubuntu-latest'
run: |
echo ${{ matrix.os }}
sudo -H apt-get -qq update
sudo -H apt-get install -y libfftw3-dev libeigen3-dev
- name: Install libfftw, etc. on MacOS
if: matrix.os == 'macos-latest'
run: |
# brew update takes forever to run. Hopefully won't need to enable this too often.
# Note: The || true bit here is because brew returns an error code if everything is
# already installed, which is goofy. So || true means these always give
# non-error values. If there really is an error, we should notice later
# when trying to use whatever package failed to install.
brew update || true
brew install fftw wget || true
brew upgrade wget || true
brew link --overwrite fftw gcc wget || true
brew install eigen || true
brew link --overwrite eigen || true
echo "LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/homebrew/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install -U pip
# Do these first to clarify potential conflicts
pip install --verbose -U setuptools numpy
# Standard dependencies
pip install --verbose -U -r requirements.txt
# Use pybind11-global to make CMake files visible
pip install --verbose -U pybind11-global
- name: Install remaining dependencies
run: |
pip install --verbose -U -r test_requirements.txt
- name: List all installed packages for reference
run: pip list
- name: Build batoid
run: CMAKE_VERBOSE_MAKEFILE=1 python setup.py develop
- name: Run unit tests
run: pytest --cov=batoid --cov-report=xml --cov-config tests/.coveragerc --skip_gha --durations=8 -ra
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true