-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (49 loc) · 1.49 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
name: main
on:
push:
branches-ignore:
- gh-pages
tags:
- '*'
pull_request:
branches-ignore:
- gh-pages
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
tag: ['cpu', 'minimal']
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.6
- name: checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: lint with flake8
run: |
pip install flake8
flake8 -v .
- name: get prebuilt ecvl image
run: docker pull dhealth/dev-ecvl-${{ matrix.tag }}
- name: build pyecvl base image
if: ${{ matrix.tag == 'cpu' }}
run: docker build --build-arg target=cpu -t dhealth/dev-pyecvl-base-cpu -f docker/Dockerfile.pyecvl-base .
- name: build pyecvl image
run: docker build -t pyecvl -f docker/Dockerfile.pyecvl-${{ matrix.tag }} .
- name: run tests
run: docker run --rm pyecvl bash -c "timeout 60 pytest tests"
- name: run examples
run: docker run --rm pyecvl bash -c "timeout 300 bash examples/run_all.sh /ecvl/examples/data"
- name: build dist package
run: |
pip install pybind11
python setup.py sdist
- name: publish to PyPI
uses: pypa/gh-action-pypi-publish@master
if: ${{ startsWith(github.ref, 'refs/tags') && matrix.tag == 'cpu' }}
with:
user: __token__
password: ${{ secrets.pypi_password }}