-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (81 loc) · 2.49 KB
/
test_build.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
name: Test
# this is heavily based off the jupyterlab-git workflow file created by @fcollonval
# https://github.com/jupyterlab/jupyterlab-git/blob/a046b66415c6afabcbdf6e624e2a367523ee2e80/.github/workflows/build.yml
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build on ${{ matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8.x"]
os: [ubuntu-20.04, windows-2019, macos-10.15]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: macos clang things
if: matrix.os == 'macos-10.15'
run: |
brew install llvm libomp
- name: install stuff
run: pip install scikit-image numpy build
# https://stackoverflow.com/a/39843038/835607
# https://stackoverflow.com/a/60564952/835607
- name: build - Mac
if: matrix.os == 'macos-10.15'
env:
CC: /usr/local/opt/llvm/bin/clang
CXX: /usr/local/opt/llvm/bin/clang
# CPPFLAGS: -I/usr/local/opt/llvm/include -fopenmp
LDFLAGS: -L/usr/local/opt/llvm/lib
run: |
python -m build .
- name: build - not mac
if: matrix.os != 'macos-10.15'
run: |
python -m build .
- uses: actions/upload-artifact@v2
with:
name: ${{matrix.os}}-${{matrix.python-version}}-wheel
path: dist/*.whl
test:
name: Test on ${{ matrix.os}}
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8.x"]
os: [ubuntu-20.04, macos-10.15]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: install stuff
run: pip install pytest numpy
- name: Download Wheels (Artifact)
uses: actions/download-artifact@v2
with:
name: ${{matrix.os}}-${{matrix.python-version}}-wheel
- name: install
run: |
pip install *.whl
- name: Tests
run: |
cd tests
python test_overlap.py
pytest --color=yes