Skip to content

Commit

Permalink
github-actions: Add code coverage job
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
  • Loading branch information
jvesely committed Oct 28, 2021
1 parent 7479ef9 commit 7821446
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
python-architecture: ['x64']
extra-args: ['']
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# 3.7 is broken on macos-11, https://github.com/actions/virtual-environments/issues/4230
- python-version: 3.7
os: macos-latest
include:
# 3.7 is broken on macos-11, https://github.com/actions/virtual-environments/issues/4230
- python-version: 3.7
Expand All @@ -36,6 +33,14 @@ jobs:
- python-version: 3.8
python-architecture: 'x86'
os: windows-latest
# code-coverage build on macos python 3.9
- python-version: 3.9
os: macos-latest
extra-args: '--cov=psyneulink'
exclude:
# 3.7 is broken on macos-11, https://github.com/actions/virtual-environments/issues/4230
- python-version: 3.7
os: macos-latest

steps:
- name: Checkout sources
Expand Down Expand Up @@ -79,17 +84,31 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
timeout-minutes: 80
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto
timeout-minutes: 180
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto ${{ matrix.extra-args }}

- name: Upload test results
uses: actions/upload-artifact@v2.2.4
with:
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}-${{ matrix.extra-args }}
path: tests_out.xml
retention-days: 5
if: success() || failure()

- name: Upload coveralls code coverage
if: contains(matrix.extra-args, '--cov=psyneulink')
shell: bash
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
# We need both coveralls and github tokens
if [ -n $COVERALLS_REPO_TOKEN -a -n $GITHUB_TOKEN ]; then
pip install coveralls
coveralls
else
echo "::warning::Not uploading to coveralls.io, token not available!"
fi
- name: Build dist
run: |
pip install setuptools wheel
Expand Down

0 comments on commit 7821446

Please sign in to comment.