-
Notifications
You must be signed in to change notification settings - Fork 2
220 lines (212 loc) · 6.23 KB
/
test.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Tests
on:
schedule:
# run every Sunday at 10:13 am UTC (3:13 am PT)
- cron: '13 10 * * 0'
push:
branches:
- main
tags:
- "v*"
pull_request:
workflow_dispatch:
jobs:
# base-tests:
# name: py${{ matrix.python }} ${{ matrix.name-modifier }} - on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# include:
# # mark default
# - python: '3.10'
# os: ubuntu-latest
# do-coverage: false
# name-modifier: ''
#
# # mark case for coverage reporting
# - python: '3.7'
# os: ubuntu-latest
# do-coverage: true
# name-modifier: 'with Coverage'
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
# - name: Install 'bapsflib' dependencies
# run: python -m pip install -r requirements/tests.txt
# - name: Run tests ${{ matrix.name-modifier }}
# run: |
# if ${{ matrix.do-coverage }}; then
# coverage run -m unittest discover
# else
# python -m unittest discover
# fi
# shell: bash
# - name: Report coverage
# if: ${{ matrix.do-coverage && !failure() }}
# uses: codecov/codecov-action@v3.1.4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: .coverage
# fail_ci_if_error: true
#
# tests:
# needs: base-tests
# name: py${{ matrix.python }} - on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
#
# strategy:
# fail-fast: false
# matrix:
# python: ['3.7', '3.8', '3.9', '3.10']
# os: [ubuntu-latest, macos-latest, windows-latest]
#
# exclude:
# # these were done in base-tests
# - python: '3.10'
# os: ubuntu-latest
# - python: '3.7'
# os: ubuntu-latest
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
# - name: Install 'bapsflib' dependencies
# run: python -m pip install -r requirements/tests.txt
# - name: Run tests
# run: |
# python -m unittest discover
# shell: bash
#
# test-mins:
# # test min versions of key dependencies
# needs: tests
# name: Min Vers | py-${{ matrix.python }} | ${{ matrix.spec-name }}
# runs-on: ubuntu-latest
#
# strategy:
# fail-fast: true
# matrix:
# include:
# - spec-name: h5py v3.0
# min-install: h5py==3.0
# python: '3.7'
#
# - spec-name: h5py v3.0 numpy v1.20
# min-install: h5py==3.0 numpy==1.20
# python: '3.7'
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
# - name: Install 'bapsflib' dependencies
# run: |
# python -m pip install -r requirements/tests.txt ${{ matrix.min-install }}
# - name: Run tests
# run: python -m unittest discover
import-bapsf_motion:
name: Importing bapsf_motion
# needs: base-tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: [ '3.10', '3.11', '3.12' ]
os: [ubuntu-latest]
architecture: [x64]
include:
- python: '3.7'
os: windows-2019
architecture: x64
- python: '3.10'
os: windows-2019
architecture: x64
- python: '3.10'
os: windows-2019
architecture: x86
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.architecture }}
- name: Upgrade pip
run: |
python -m pip install pip --upgrade
- name: Install 'bapsf_motion' dependencies
if: ${{ matrix.architecture == 'x64' }}
run: |
python -m pip install -r requirements/gui.txt
- name: Install additional PySide6 dependencies [Linux Systems ONLY]
if: ${{ matrix.architecture == 'x64' && runner.os != 'Windows'}}
run: |
sudo apt update && sudo apt install -y libegl1-mesa-dev
- name: Install 'bapsf_motion' dependencies (32bit)
if: ${{ matrix.architecture == 'x86' }}
run: |
python -m pip install -r requirements/install.txt
- name: Import 'bapsf_motion'
run: |
python -c 'import bapsf_motion'
- name: Import 'bapsf_motion.gui'
if: ${{ matrix.architecture == 'x64' }}
run: |
python -c 'import bapsf_motion.gui'
build-bapsf_motion:
name: Packaging
runs-on: ubuntu-latest
needs:
# - test-mins
- import-bapsf_motion
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
- name: Install requirements
run: |
pip install --progress-bar off --upgrade pip setuptools setuptools_scm twine build
pip install --progress-bar off -r requirements/install.txt
- name: Build a binary wheel
run: |
python -m build --wheel --outdir dist/
- name: Build a source tarball
run: |
python -m build --sdist --outdir dist/
- name: Twine check
run: |
twine check dist/*
- name: Install bapsf_motion in all variants
run: |
pip install --progress-bar off .[install]
pip install --progress-bar off -e .[install]