-
Notifications
You must be signed in to change notification settings - Fork 3
119 lines (113 loc) · 4.25 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
# GitHub Actions Continuous Integration workflow for MagellanMapper
# Based on initial template by GitHub Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
dependencies:
- pinned
- fresh
exclude:
- os: ubuntu-latest
python-version: 3.6
- os: ubuntu-latest
python-version: 3.7
- os: macos-13
python-version: 3.10
- os: macos-13
python-version: 3.11
- os: macos-latest
python-version: 3.6
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9
include:
- os: ubuntu-20.04
python-version: 3.6
dependencies: pinned
- os: ubuntu-20.04
python-version: 3.6
dependencies: fresh
- os: ubuntu-20.04
python-version: 3.7
dependencies: pinned
- os: ubuntu-20.04
python-version: 3.7
dependencies: fresh
env:
# set requirements path based on Python version
REQS: ${{ matrix.python-version == '3.6' && 'envs/requirements_py36' || matrix.python-version == '3.7' && 'envs/requirements_py37' || matrix.python-version == '3.8' && 'envs/requirements_py38' || 'envs/requirements.txt'}}
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Install VTK dependencies
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libsm6 libgl1 libglx-mesa0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
if: ${{ matrix.dependencies == 'pinned' }}
with:
# python environment path from setup-python
path: ${{ env.pythonLocation }}
# check for cache from the corresponding requirements file
key: ${{ env.pythonLocation }}-pip-${{ hashFiles(env.REQS) }}
- name: Set up dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install flake8
- name: Install pinned dependencies
if: ${{ matrix.dependencies == 'pinned' }}
env:
QT_QPA_PLATFORM: offscreen
run: |
pip install -r ${{ env.REQS }}
- name: Install fresh dependencies
if: ${{ matrix.dependencies == 'fresh' }}
env:
QT_QPA_PLATFORM: offscreen
run: |
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude stitch
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude stitch
- name: Test with pytest
run: |
python -u -m magmap.tests.test_chunking
python -u -m magmap.tests.test_classifier
python -u -m magmap.tests.test_cv_nd
python -u -m magmap.tests.test_detector
python -u -m magmap.tests.test_libmag
python -u -m magmap.tests.test_np_io
# TODO: add UI testing
#python -u -m magmap.tests.test_visualizer
# TODO: add image artifacts
#python -u -m magmap.tests.test_img_equality
#python -u -m magmap.tests.unit_testing