Skip to content

Commit

Permalink
Merge pull request #514 from afuetterer/coveralls
Browse files Browse the repository at this point in the history
ci: switch to coverallsapp/github-action
  • Loading branch information
huberrob authored Jul 23, 2024
2 parents 75c1199 + bc136bc commit b63b7f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 125 deletions.
48 changes: 7 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ concurrency:
cancel-in-progress: true

env:
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1 # colored output by pytest etc.

permissions: {} # Set permissions at the job level.
Expand All @@ -31,51 +30,18 @@ jobs:
extra_args: --all-files --color=always

tests:
runs-on: ubuntu-22.04
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- name: Install python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade hatch
- run: |
python -m pip install --upgrade pip
python -m pip install hatch
- name: Run test suite with coverage
run: hatch run cov-ci
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
retention-days: 1
path: pytest-junit.xml
- name: Upload coverage results
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-results
retention-days: 1
path: pytest-cobertura.xml
- run: rm ./reports/coverage/.gitignore
- name: Generate coverage badge
if: github.ref == 'refs/heads/master'
run: hatch run cov-badge
- name: Deploy reports to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@65b5dfd4f5bcd3a7403bbc2959c144256167464e # v4.5.0
with:
folder: ./reports

event_file:
runs-on: ubuntu-22.04
steps:
- uses: actions/upload-artifact@v4
with:
name: event-file
retention-days: 1
path: ${{ github.event_path }}
run: hatch run cov --cov-report=xml
- name: Upload coverage data to coveralls.io
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0
78 changes: 0 additions & 78 deletions .github/workflows/reports.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Developers: [Robert Huber](mailto:[email protected]), [Anusuriya Devaraju](mailto:
Thanks to [Heinz-Alexander Fuetterer](https://github.com/afuetterer) for his contributions and his help in cleaning up the code.

[![CI](https://github.com/pangaea-data-publisher/fuji/actions/workflows/ci.yml/badge.svg)](https://github.com/pangaea-data-publisher/fuji/actions/workflows/ci.yml)
[![Coverage](https://pangaea-data-publisher.github.io/fuji/coverage/coveragebadge.svg)](https://pangaea-data-publisher.github.io/fuji/coverage/)
[![Coverage](https://coveralls.io/repos/github/pangaea-data-publisher/fuji/badge.svg?branch=master)](https://coveralls.io/github/pangaea-data-publisher/fuji?branch=master)

[![Publish Docker image](https://github.com/pangaea-data-publisher/fuji/actions/workflows/publish-docker.yml/badge.svg)](https://github.com/pangaea-data-publisher/fuji/actions/workflows/publish-docker.yml)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11084909.svg)](https://doi.org/10.5281/zenodo.11084909)
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ version = "3.2.0"

[project.optional-dependencies]
dev = [
"fuji[lint]",
"fuji[testing]"
"fuji[lint,testing]"
]
docs = [
"myst-parser~=3.0",
Expand All @@ -81,7 +80,6 @@ report = [
"jupyter~=1.0"
]
testing = [
"genbadge[coverage]~=1.1",
"pytest~=8.0",
"pytest-cov~=5.0",
"pytest-randomly~=3.15",
Expand Down Expand Up @@ -125,8 +123,6 @@ features = [

[tool.hatch.envs.default.scripts]
cov = "pytest --cov {args}"
cov-badge = "genbadge coverage --input-file=pytest-cobertura.xml --output-file=./reports/coverage/coveragebadge.svg"
cov-ci = "pytest --cov --junitxml=pytest-junit.xml --cov-report=xml:pytest-cobertura.xml --cov-report=html:./reports/coverage/ {args}"
lint = "pre-commit run --all-files --color=always {args}"
test = "pytest {args}"

Expand Down

0 comments on commit b63b7f0

Please sign in to comment.