@@ -3,34 +3,129 @@ name: CI
33on :
44 push :
55 branches :
6- - main
6+ - master
7+ - v0.*.x
8+ tags :
9+ - " v*"
710 pull_request :
811
912jobs :
10- build :
11-
12- runs-on : ubuntu-latest
13+ tests :
14+ name : ${{ matrix.name }}
15+ runs-on : ${{ matrix.os }}
1316 strategy :
17+ fail-fast : false
1418 matrix :
15- python-version : [3.7, 3.8]
19+ include :
20+
21+ - name : Python 3.7 with minimal dependencies
22+ os : ubuntu-latest
23+ python : 3.7
24+ toxenv : py37-minimal
25+
26+ - name : Python 3.7
27+ os : ubuntu-latest
28+ python : 3.7
29+ toxenv : py37
30+
31+ - name : Python 3.7 with Astropy dev
32+ os : ubuntu-latest
33+ python : 3.7
34+ toxenv : py37-astropydev
35+
36+ - name : Python 3.9 with SunPy dev
37+ os : ubuntu-latest
38+ python : 3.9
39+ toxenv : py39-sunpydev
40+
41+ - name : Python 3.8 with code coverage
42+ os : ubuntu-latest
43+ python : 3.8
44+ toxenv : py38-cov
45+
46+ - name : Python 3.8 with Numpy dev
47+ os : ubuntu-latest
48+ python : 3.8
49+ toxenv : py38-numpydev
50+
51+ - name : Python 3.9
52+ os : ubuntu-latest
53+ python : 3.9
54+ toxenv : py39
55+
56+ - name : Python 3.9 (Windows)
57+ os : windows-latest
58+ python : 3.9
59+ toxenv : py39
60+ toxposargs : --durations=50
61+
62+ - name : Python 3.8 (MacOS X)
63+ os : macos-latest
64+ python : 3.8
65+ toxenv : py38
66+
67+ - name : Documentation
68+ os : ubuntu-latest
69+ python : 3.9
70+ toxenv : build_docs
71+
72+ - name : Linters
73+ os : ubuntu-latest
74+ python : 3.9
75+ toxenv : linters
1676
1777 steps :
18- - uses : actions/checkout@v2
19- - name : Set up Python ${{ matrix.python-version }}
78+ - name : Checkout code
79+ uses : actions/checkout@v2
80+ with :
81+ fetch-depth : 0
82+ - name : Set up Python
2083 uses : actions/setup-python@v2
2184 with :
22- python-version : ${{ matrix.python-version }}
23- - name : Install dependencies
85+ python-version : ${{ matrix.python }}
86+ - name : Install Python dependencies
87+ run : python -m pip install --upgrade tox codecov
88+ - name : Install language-pack-fr and tzdata
89+ if : startsWith(matrix.name, 'Documentation')
90+ run : sudo apt-get install graphviz pandoc
91+ - name : Run tests
92+ run : tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
93+ - name : Upload coverage to codecov
94+ if : ${{ contains(matrix.toxenv,'-cov') }}
95+ uses : codecov/codecov-action@v1
96+ with :
97+ file : ./coverage.xml
98+ build-n-publish :
99+ name : Packaging
100+ runs-on : ubuntu-18.04
101+ needs : tests
102+ steps :
103+ - uses : actions/checkout@master
104+ - name : Get history and tags for SCM versioning to work
24105 run : |
25- python -m pip install --upgrade pip
26- pip install flake8 pytest pytest-doctestplus
27- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28- - name : Lint with flake8
106+ git fetch --prune --unshallow
107+ git fetch --depth=1 origin +refs/tags/*:refs/tags/*
108+ - name : Set up Python 3.7
109+ uses : actions/setup-python@v1
110+ with :
111+ python-version : 3.7
112+ - name : Install requirements
29113 run : |
30- # stop the build if there are Python syntax errors or undefined names
31- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34- - name : Test with pytest
114+ pip install --upgrade pip
115+ pip install setuptools numpy wheel setuptools_scm twine
116+ - name : Build a binary wheel
117+ run : python setup.py bdist_wheel
118+ - name : Build a source tarball
119+ run : python setup.py sdist
120+ - name : Twine check
121+ run : twine check dist/*
122+ - name : Install PlasmaPy in all variants
35123 run : |
36- pytest
124+ pip install --progress-bar off .[all,dev]
125+ pip install -e .[all,dev]
126+ python setup.py develop
127+ - name : Publish distribution, if tagged, 📦 to PyPI
128+ if : ${{ startsWith(github.ref, 'refs/tags') && !endsWith(github.ref, 'dev') }}
129+ uses : pypa/gh-action-pypi-publish@master
130+ with :
131+ password : ${{ secrets.pypi_access_token }}
0 commit comments