Skip to content

Commit

Permalink
Add badges, update workflows & names #24 (#59)
Browse files Browse the repository at this point in the history
* Add badges, update workflows & names #24

* Add coverage report upload and update readme badge link #24

* Downgrade artifact for easier compatibility #24

See actions/upload-artifact#478

* Move and test dev PR coverage and upload to GH pages, update badge link #24

* Add html report, fix directory structure, fix content overwriting #24

* Remove previous coverage_badge.json from GH pages, add recursive directory creation #24

* Catch mistakes for uploading the coverage_report directory #24

* Move step in which the html reports are generated #24

* Update python code quality version (Version 3.11.6 was not found in the local cache) and mkdir coverage_report #24

* Fix attempt: Explicitly create all directories #24

* Fix attempt: Explicitly state publish branch #24

* Remove broken link to html coverage report #24
  • Loading branch information
MarcoHuebner authored Apr 30, 2024
1 parent 98f1884 commit 196ebd1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy docs
name: GitHub Pages

on:
push:
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run tests
name: Tests, Code Quality and Documentation

on:
push:
Expand Down Expand Up @@ -43,19 +43,21 @@ jobs:
- name: Run tests
run: |
poetry run pytest --cov=pystatis tests
code-quality:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
# only support specific python version, as guidelines differ beween (minor) versions
python-version: ["3.11.6"]
python-version: ["3.11.7"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run poetry image
Expand All @@ -78,7 +80,8 @@ jobs:
run: poetry run safety check
- name: Run mypy
run: poetry run mypy src
sphinx-documentation:

sphinx-documentation-and-coverage:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
Expand Down Expand Up @@ -111,3 +114,17 @@ jobs:
name: docs
path: docs/build/html/*
retention-days: 5
- name: Generate and filter test coverage report
run: |
poetry run coverage run -m pytest
poetry run coverage json -o assets/coverage.json
cov=$(jq -r '.totals.percent_covered_display' assets/coverage.json)
echo "{\"label\":\"Test Coverage\",\"message\":\"${cov}%\",\"schemaVersion\":1,\"color\":\"hsl(120, 100%, 40%)\"}" > assets/coverage_badge.json
# compromise: Due to versioning issues, only display
# coverage (report) for main (on/push/branches/main)
- name: Prepare files
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
set -e
mkdir -p output/publish
cp assets/coverage_badge.json output/publish/
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ``pystatis``

![Tests, Code Quality and Documentation](https://github.com/CorrelAid/pystatis/actions/workflows/run-tests.yaml/badge.svg?event=push)
![Code Coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fcorrelaid.github.io%2Fpystatis%2Fpublish%2Fcoverage_badge.json
)
![GitHub Pages Documentation](https://github.com/CorrelAid/pystatis/actions/workflows/deploy-docs.yaml/badge.svg?event=push)

```pystatis``` is a Python wrapper for the different GENESIS web service interfaces (API). Currently we are supporting the following databases:

- [GENESIS-Online](https://www-genesis.destatis.de/genesis/online)
Expand Down

0 comments on commit 196ebd1

Please sign in to comment.