Skip to content

Commit 93b3a4b

Browse files
committed
Add unit tests GH action, rm old CI stuff (#10)
1 parent 9839dff commit 93b3a4b

8 files changed

Lines changed: 47 additions & 52 deletions

File tree

.codeclimate.yml

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

.coveragerc

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

.github/workflows/unit_tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: unit tests
2+
3+
on:
4+
push: # run on every push or PR to any branch
5+
pull_request:
6+
schedule: # run automatically on main branch each Tuesday at 11am
7+
- cron: "0 16 * * 2"
8+
9+
jobs:
10+
python-unit:
11+
name: Python unit tests
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python: ["3.12"]
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python }}
24+
25+
# We base the python cache on the hash of all requirements files, so that
26+
# if any change, the cache is invalidated.
27+
- name: Cache pip
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/pip
31+
key: pip-${{ hashFiles('pyproject.toml') }}
32+
restore-keys: |
33+
pip-${{ hashFiles('pyproject.toml') }}
34+
pip-
35+
36+
- name: Install package with dependencies
37+
run: |
38+
pip install -e .
39+
pip install -e '.[test]'
40+
pip install codecov
41+
42+
- name: Run pytest
43+
run: pytest --cov=neuxml --cov-report=xml
44+
45+
- name: Upload test coverage to Codecov
46+
uses: codecov/codecov-action@v3

.travis.yml

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

DEVNOTES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To run all unit tests::
2626
pytest
2727

2828
# for continuous integration
29-
pytest --cov=./ --cov-report=xml
29+
pytest --cov=neuxml --cov-report=xml
3030

3131
To run unit tests for a specific module, use syntax like this::
3232

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# 'logo': 'logo.png',
2323
"github_user": "Princeton-CDH",
2424
"github_repo": "neuxml",
25-
# 'travis_button': True, # enable when we get travis-ci set up
2625
"description": "Python library to read and write structured XML",
2726
# 'analytics_id':
2827
}

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ dev = [
3232
"pytest>=4.6",
3333
"pytest-cov",
3434
"pytest-socket",
35-
"tox",
3635
"requests",
3736
"pre-commit",
3837
]

tox.ini

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

0 commit comments

Comments
 (0)