Skip to content

Commit 2369507

Browse files
authored
Merge pull request #76 from phobson/switch-to-ghactions
Add remaining GH action workflows
2 parents 5be9ad0 + 97ad4a7 commit 2369507

29 files changed

+2196
-1377
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run coverage via codecov
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Setup Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
- name: Generate coverage report
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install pytest pytest-cov pytest-mpl coverage docopt
21+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
22+
pip install scipy
23+
export MPL_IMGCOMP_TOLERANCE=20
24+
coverage run --source probscale check_probscale.py --doctest-modules --mpl --cov-report=xml
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v1
27+
with:
28+
# directory: ./coverage/reports/
29+
flags: unittests
30+
name: codecov-umbrella
31+
fail_ci_if_error: true
32+
path_to_write_report: ./codecov_report.gz

.github/workflows/python-publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.PMH_PYPI_USER }}
28+
TWINE_PASSWORD: ${{ secrets.PMH_PYPI_PASS }}
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
twine upload dist/*
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Lint with flake8
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install flake8
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Lint with flake8
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude .git,docs/*
31+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Run basic unit tests
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.5, 3.6, 3.7, 3.8]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install pytest docopt
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Test with pytest
32+
run: |
33+
python check_probscale.py --doctest-modules
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Run image comparison tests
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install pytest pytest-mpl docopt
26+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27+
- name: Test with pytest
28+
run: |
29+
export MPL_IMGCOMP_TOLERANCE=20
30+
python check_probscale.py --mpl --doctest-modules

.travis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

check_probscale.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import sys
22
import matplotlib
3-
matplotlib.use('agg')
3+
4+
matplotlib.use("agg")
45

56
from matplotlib.pyplot import style
6-
style.use('classic')
7+
8+
style.use("classic")
79

810
from probscale import tests
11+
912
status = tests.test(*sys.argv[1:])
1013
sys.exit(status)

conda.recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: mpl-probscale
3-
version: 0.2.3
3+
version: 0.2.4
44

55
source:
66
path: ../

0 commit comments

Comments
 (0)