-
Notifications
You must be signed in to change notification settings - Fork 57
203 lines (167 loc) · 5.76 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: GitHub CI
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: On ${{ matrix.os }} with (${{ matrix.compiler }}, python-${{ matrix.python-version }}, numpy-${{ matrix.numpy-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest"]
compiler: [gcc-7, gcc-9, clang]
python-version: ["3.9", "3.12"]
numpy-version: ["1.20", "2.0.1"]
include:
- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.10"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.10"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.10"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.10"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.11"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.11"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-12
python-version: "3.11"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.11"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.11"
os: ubuntu-latest
- numpy-version: "1.23"
compiler: gcc-12
python-version: "3.11"
os: ubuntu-latest
exclude:
# Only run with 'clang' on OSX
- os: "macos-latest"
compiler: gcc-7
- os: "macos-latest"
compiler: gcc-9
# Don't use 'clang' on linux
- os: "ubuntu-20.04"
compiler: clang
- os: "ubuntu-latest"
compiler: clang
# only gcc-10 on latest
- os: "ubuntu-latest"
compiler: gcc-9
- os: "ubuntu-latest"
compiler: gcc-7
# Only use latest numpy on ubuntu-latest
- os: "ubuntu-latest"
numpy-version: 1.20
# python3.10 only on ubuntu-latest
# - os: "ubuntu-20.04"
# python-version: "3.10"
# - os: "macos-latest"
# python-version: "3.10"
- python-version: "3.9"
numpy-version: "2.0.1"
- python-version: "3.12"
numpy-version: "1.20"
env:
CC: ${{ matrix.compiler }}
CORRFUNC_CI: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: false
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}
# This was needed on 18.04 but not on 20.04
# - name: Install binutils on linux
# shell: bash -l {0}
# if: matrix.os == 'ubuntu-18.04'
# run: |
# sudo apt-get update
# sudo apt-get install binutils
- name: Install gcc-7 on ubuntu-20.04
shell: bash -l {0}
if: matrix.os == 'ubuntu-20.04'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7
- name: Install dependencies
shell: bash -l {0}
run: |
conda create -q --yes -n test python=${{ matrix.python-version }} nomkl
conda activate test
conda install -q --yes -c conda-forge numpy=${{ matrix.numpy-version }} gsl
- name: Display PATH, compiler, python
shell: bash -l {0}
run: |
conda activate test
echo "PATH = " $PATH
echo "COMPILER = " `which ${{ matrix.compiler }}`
echo "COMPILER VERSION = " `${{ matrix.compiler }} --version`
echo "PYTHON = " `which python`
echo "(PYTHON, NUMPY) version = " `python -c "import sys; import numpy as np; print(sys.version); print(np.__version__);"`
echo "Preprocessor defs:"
echo `${{ matrix.compiler }} -dM -E - -march=native`
- name: lscpu on Linux
if: matrix.os != 'macos-latest'
run: |
lscpu
- name: sysctl machdep.cpu on OSX
if: matrix.os == 'macos-latest'
run: |
sysctl machdep.cpu
# - name: Add linker flag to OSX + gcc
# shell: bash -l {0}
# if: matrix.os == 'osx-latest' && startswith(matrix.compiler, 'gcc')
# run: export CLINK = '-lgomp'
- name: compile
shell: bash -l {0}
run: make -r CC=${{ matrix.compiler }}
- name: install
shell: bash -l {0}
run: make install CC=${{ matrix.compiler }}
- name: compile and install python extensions
shell: bash -l {0}
run: |
echo "CC = " $CC
export CC=${{ matrix.compiler }}
python -m pip install -e .
- name: tests
shell: bash -l {0}
run: make tests CC=${{ matrix.compiler }}
- name: doctests
shell: bash -l {0}
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && matrix.numpy-version == '1.16'
run: |
python -m pip install 'sphinx>=1.8'
make -C docs doctest
- name: Python tests
shell: bash -l {0}
run: |
python -m pip install pytest
python -m pytest -v