Skip to content

Commit

Permalink
Merge pull request #40 from kbevers/coveralls
Browse files Browse the repository at this point in the history
Add Coveralls integration to CI setup
  • Loading branch information
kbevers authored Apr 7, 2022
2 parents 9f0e83c + 30a62f6 commit d273a9f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
39 changes: 25 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,33 @@ jobs:
- run: 'docker run -d -p 0.0.0.0:5000:80 --name restapi webproj'
- run: docker ps
- run: sudo apt-get update
- run: >-
wget
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-O miniconda.sh
- run: |
bash miniconda.sh -b -p $HOME/miniconda
source "$HOME/miniconda/etc/profile.d/conda.sh"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
conda env create -f environment-dev.yaml
conda activate webproj
pytest --cov

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
environment-file: environment-dev.yaml
auto-activate-base: false
activate-environment: webproj
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Pytest
run: pytest --cov

- run: >-
docker exec restapi curl -s
localhost/v1.0/trans/EPSG:4258/DK:S34S/55.0,12.0 > S34S.out
- run: cat S34S.out
- run: diff test_s34s.out S34S.out

- name: Covert Coverage Results
run: |
coveragepy-lcov --data_file_path .coverage --output_file_path lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.pytest_cache
__pycache__
.coverage
lcov.info
2 changes: 2 additions & 0 deletions environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ dependencies:
- pytest
- coverage
- pytest-cov
- pip:
- coveragepy-lcov
2 changes: 1 addition & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ dependencies:
- pip>=20.0
- werkzeug>=1.0
- flask>=1.0
- flask-x>=0.1.1
- flask-restx>=0.1.1
- flask-cors>=3.0
- pyproj>=3.3

0 comments on commit d273a9f

Please sign in to comment.