Skip to content

Commit

Permalink
Replace Travis CI with GitHub Actions (#96)
Browse files Browse the repository at this point in the history
Since Travis CI is no longer free, this PR swaps it out for GitHub Actions.

Other notable changes:
- `nose` is replaced by `pytest` and `pytest-cov`
  • Loading branch information
petergardfjall committed May 18, 2023
1 parent eb85eae commit 8358623
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 17 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests
run: |
make ci-test
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ dev-init: dep-sync

# update pinned versions of abstract dependencies from setup.py
dep-update:
(source $(VENV_ACTIVATE) ; pip-compile --upgrade -o requirements.txt)
(source $(VENV_ACTIVATE) ; pip-compile --upgrade --extra test -o requirements-dev.txt)
(source $(VENV_ACTIVATE) ; pip-compile --upgrade --resolver=backtracking -o requirements.txt)
(source $(VENV_ACTIVATE) ; pip-compile --upgrade --resolver=backtracking --extra test -o requirements-dev.txt)


# build release under 'dist/'
Expand All @@ -42,4 +42,7 @@ clean:
rm -rf build dist garminexport.egg-info

test:
nosetests --verbose --with-coverage --cover-package=garminexport --cover-branches
pytest --cov=garminexport

ci-test:
pytest tests --junitxml=report.xml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![Build badge](https://github.com/petergardfjall/garminexport/actions/workflows/run-tests.yaml/badge.svg)
[![PyPi release](https://img.shields.io/pypi/v/garminexport.svg)](https://img.shields.io/pypi/v/garminexport.svg)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/garminexport)
![PyPI - License](https://img.shields.io/pypi/l/garminexport)
Expand Down
30 changes: 20 additions & 10 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,39 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --extra=test --output-file=requirements-dev.txt
# pip-compile --extra=test --output-file=requirements-dev.txt --resolver=backtracking
#
certifi==2023.5.7
# via requests
charset-normalizer==3.1.0
# via requests
coverage==4.5.4
# via garminexport (setup.py)
coverage[toml]==7.2.5
# via pytest-cov
exceptiongroup==1.1.1
# via pytest
idna==3.4
# via requests
mock==2.0.0
# via garminexport (setup.py)
nose==1.3.7
iniconfig==2.0.0
# via pytest
packaging==23.1
# via pytest
pluggy==1.0.0
# via pytest
pytest==7.3.1
# via
# garminexport (setup.py)
# pytest-cov
pytest-cov==4.0.0
# via garminexport (setup.py)
pbr==5.11.1
# via mock
python-dateutil==2.8.2
# via garminexport (setup.py)
requests==2.30.0
# via garminexport (setup.py)
six==1.16.0
# via python-dateutil
tomli==2.0.1
# via
# mock
# python-dateutil
# coverage
# pytest
urllib3==2.0.2
# via requests
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --output-file=requirements.txt
# pip-compile --output-file=requirements.txt --resolver=backtracking
#
certifi==2023.5.7
# via requests
Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ classifiers =
Natural Language :: English
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11


[options]
Expand All @@ -42,7 +43,7 @@ install_requires =

[options.extras_require]
cloudflare = cloudscraper~=1.2
test = nose~=1.3; coverage~=4.2; mock~=2.0
test = pytest~=7.3; pytest-cov~=4.0

[options.entry_points]
console_scripts =
Expand Down

0 comments on commit 8358623

Please sign in to comment.