Skip to content

Commit

Permalink
[GitHub Actions] Setup Tests via Github Actions (#561)
Browse files Browse the repository at this point in the history
* creating test.yml

still need to add test changes for this to work

* testing addition of coveralls

* add coveralls token

* edit token

* edit token 2

* migrate to GitHub Actions secrets

* remove duplicate testing on push and PR

* Test new Coveralls set up

Using similar set up as to [here](https://github.com/marketplace/actions/coveralls-github-action)

* removing `flag-name` input

* Remove .coveralls.yml

* GA: Remove Python 3.6 from the build matrix

Otherwise, scipy returns this error during installation:
RuntimeError: Python version >= 3.7 required.

* GA: Use nose to run the tests

* Use AndreMiras' version of Coveralls action

According to coverallsapp/github-action#4 (comment),
this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action.

* Remove .travis.yml

* Add relative_files = True in .coveragerc

* GA: Ignore Python 3.7 on Windows

* Remove unused coveralls lib

* Remove pytest

* Add comment for running performance test

Co-authored-by: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com>
Co-authored-by: Matt McKay <mamckay@gmail.com>
  • Loading branch information
3 people committed Jan 2, 2021
1 parent 08a15f5 commit 128ed39
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[run]
# relative_files = True is necessary as per documentation of
# https://github.com/AndreMiras/coveralls-python-action
relative_files = True
source = quantecon
omit =
*/python?.?/*
Expand Down
2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: continuous-integration

# We ignore Python 3.7 on windows-latest because 3 tests are failing:
# - FAIL: test_quadrect_2d_H (quantecon.tests.test_quad.TestQuadrect)
# AssertionError:
# Not equal to tolerance rtol=1e-07, atol=0
# - FAIL: test_quadrect_2d_H2 (quantecon.tests.test_quad.TestQuadrect)
# AssertionError:
# Not equal to tolerance rtol=1e-07, atol=0
# - The last error can't be found from the log
#
# Run this occasionally to test performance:
# nosetests -a "slow"

on:
push:
branches:
- master
pull_request:

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.7
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U nose coverage numpy scipy pandas numba sympy ipython statsmodels flake8
pip install tables
python setup.py install
- name: Run Tests
run: |
flake8 --select F401, F405,E231 quantecon
nosetests --with-coverage -a "!slow" --cover-package=quantecon
- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
if: runner.os == 'Linux'
with:
flag-name: run-${{ matrix.test_number }}
parallel: true
coveralls_finish:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

0 comments on commit 128ed39

Please sign in to comment.