forked from imageio/imageio
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (114 loc) · 3.41 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
name: CI
# This action runs through ImageIO's continous integration pipeline. It
# performs the following checks:
#
# - Linting/Style (Black)
# - Invokes the unit tests in no-internet mode on python 3.8
# - runs unit test on cypthon in matrix mode (python 3.6, 3.7, 3.8, 3.9) x (3 major OS)
# - runs unit tests on pypy in matrix mode (pypy 3.6, 3.7) x (3 major OS)
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
style:
name: "Linting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@20.8b1
with:
args: ". --check"
- name: Install Dependencies
shell: bash
run: |
pip install .[linting]
- name: Flake8
uses: liskin/gh-problem-matcher-wrap@v1
with:
linters: flake8
run: flake8 .
no-internet:
name: "No-Internet Install"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Dependenceis
run: |
# Build to force downloading images (but this step needs numpy and pillow)
pip install -q -U numpy pillow
python setup.py sdist
pip install .[test,ffmpeg]
# Delete the local copy, so we're actually using the installed version
rm -rf ./imageio ./build ./egg-info
- name: Unit tests
run: |
invoke test --installed
cpython:
name: "${{ matrix.os }} / CPython ${{ matrix.pyversion }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
pyversion: ["3.6", "3.7", "3.8", "3.9"]
include:
- name: Linux py37 full
os: ubuntu-latest
pyversion: '3.7'
TEST_UNIT: 1
TEST_FULL: 1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.pyversion }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyversion }}
- name: Install dependencies for tests
shell: bash
run: |
pip install .[test,ffmpeg]
- name: Install optional dependencies for tests
if: matrix.TEST_FULL == 1
run: |
pip install -q -U simpleitk astropy
- name: Run All Unit tests
run: |
coverage run -m pytest -v
- name: Upload coverage to Codecov
run: |
curl -s https://codecov.io/bash | bash
shell: bash
pypy:
name: "${{ matrix.os }} / ${{ matrix.pyversion }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest"]
pyversion: ["pypy-3.6", "pypy-3.7"]
steps:
- uses: actions/checkout@v2
- name: Set up pypy
uses: actions/setup-python@v2
with:
python-version: "pypy3"
- name: MacOS Numpy Fix
if: runner.os == 'macOS'
run: |
brew install openblas
OPENBLAS="$(brew --prefix openblas)" pypy3 -m pip install numpy
- name: Install dependencies
shell: bash
run: |
pypy3 -m pip install .[test,ffmpeg]
- name: Run Unit tests
run: |
invoke test --unit