Skip to content

Commit

Permalink
Merge pull request #329 from techman83/fix/coverage
Browse files Browse the repository at this point in the history
Re-enable Coverage
  • Loading branch information
techman83 authored Mar 24, 2024
2 parents b4660c3 + b6f58a6 commit 6de6c72
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 36 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/coverage-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Coverage

on:
pull_request:
branches:
- master

jobs:
coverage-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: netkan
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: netkan/setup.py
- name: Install test dependencies
run: pip install .[test]
- name: force our git config
run: cp .gitconfig ~/.
- name: Run Coverage
run: |
coverage run -m pytest
coverage xml
- name: Upload Coverage
uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: netkan/coverage.xml
retention-days: 1
29 changes: 29 additions & 0 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Report Coverage

on:
workflow_run:
workflows:
- Build Coverage
types:
- completed

permissions:
actions: read
contents: read
pull-requests: write

jobs:
coverage-report:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/download-artifact@v4
with:
name: coverage.xml
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Cover
uses: techman83/coverage@feat/workflow_run
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 0 additions & 34 deletions .github/workflows/coverage.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip
cache-dependency-path: netkan/setup.py
- name: Install Dependencies
run: |
pip install netkan/.
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip
cache-dependency-path: netkan/setup.py
- name: Install test dependencies
working-directory: netkan
run: pip install .[test]
Expand Down

0 comments on commit 6de6c72

Please sign in to comment.