-
Notifications
You must be signed in to change notification settings - Fork 155
64 lines (61 loc) · 1.95 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
name: CI
on: [push]
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
name: "Checkout branch"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: "Linting test"
run: |
pip install flake8
- name: "Linting test"
run: |
flake8 src
test:
name: Tests
# This job runs on Linux
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
# Note: We need to quote '3.10' and '3.11' otherwise it's interpreted as as number, e.g. 3.1
python-version: [3.7, 3.8, 3.9, '3.10', "3.11"]
steps:
- uses: actions/checkout@v1
name: "Checkout branch"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: |
# We need to install numpy by hand, to prevent manual compilation on py3.5 which fails...
pip install numpy
pip install .[plot] pytest
sudo apt-get update --yes && sudo apt-get install graphviz
name: "Install dependencies"
- run: |
cd tests && MATPLOTLIBRC="../ci" pytest ./
name: "Run the tests"
publish:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
name: Publish the package to PyPI
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
# Pip doesn't support building a sdist when in PEP517 mode, so use a dedicated package for this
- run: pip install build && python -m build --sdist --wheel
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: phylliadebot
password: ${{ secrets.phylliadebot_pass }}