-
Notifications
You must be signed in to change notification settings - Fork 27
146 lines (128 loc) · 4.37 KB
/
main.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
# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions. For more information see:
# https://help.github.com/actions/language-and-framework-guides/
# using-python-with-github-actions
name: pytest with flake8
on:
pull_request:
push:
schedule:
- cron: "0 3 * * 1" # Runs 03:00 UT on Mondays
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
numpy_ver: ["latest"]
test_config: ["latest"]
include:
# Support different GA Mac environmnets
- python-version: "3.9"
os: "macos-13"
numpy_ver: "latest"
- python-version: "3.10"
os: "macos-13"
numpy_ver: "latest"
- python-version: "3.11"
os: "macos-latest"
numpy_ver: "latest"
- python-version: "3.12"
os: "macos-latest"
numpy_ver: "latest"
# NEP29 compliance settings
- python-version: "3.10"
numpy_ver: "1.25"
os: "ubuntu-latest"
test_config: "NEP29"
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with Numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Install Windows-specific dependencies for non-pip install
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install ninja mingw
choco install rtools --no-progress
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
gfortran --version
pip install flake8 meson-python pytest pytest-cov pytest-xdist scipy
pip install "numpy>=1.19.5"
- name: Install NEP29 dependencies
if: ${{ matrix.test_config == 'NEP29'}}
run: |
pip install numpy==${{ matrix.numpy_ver }}
- name: Install on Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pip install --upgrade-strategy only-if-needed .[test]
- name: Install on MacOS-13
if: ${{ matrix.os == 'macos-13' }}
run: |
brew reinstall gcc@14
CC=/usr/local/bin/gcc-14 pip install --upgrade-strategy only-if-needed .[test]
- name: Install on MacOS-Latest
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew reinstall gcc@14
CC=/opt/homebrew/bin/gcc-14 pip install --upgrade-strategy only-if-needed .[test]
- name: Install on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
meson setup build
ninja -j 2 -C build
cd build
meson install --destdir=${{ env.Python3_ROOT_DIR }}
- name: Test PEP8 compliance
run: flake8 . --count --show-source --statistics
- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Run unit and integration tests on Mac/Linux
if: ${{ matrix.os != 'windows-latest' }}
run: |
cd ..
coverage run -m pytest
coverage report
coverage xml
mv coverage.xml apexpy/.
- name: Run unit and integration tests on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
cd ..
coverage run -m pytest
coverage report
coverage xml
mv coverage.xml apexpy\.
- name: Publish results to coveralls upon success
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run=${{ join(matrix.*, '-') }}
parallel: true
format: cobertura
- name: Create a Windows wheel
if: ${{ matrix.os == 'windows-latest' }}
run: |
mkdir dist
pip wheel . -w dist
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: dist/*.whl
if-no-files-found: warn
finish:
name: Finish Coverage Analysis
needs: build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true