Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Unit Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

Expand All @@ -26,4 +28,19 @@ jobs:

- name: Run tests with coverage
run: |
pytest --cov=src/aquasense --cov-report=term --cov-branch
pytest --cov=src/aquasense --cov-report=term --cov-report=html:coverage-html --cov-branch

- name: Deploy coverage to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin gh-pages
git worktree add gh-pages-deploy gh-pages
rm -rf gh-pages-deploy/coverage
cp -r coverage-html gh-pages-deploy/coverage
cd gh-pages-deploy
git add -A
git diff --cached --quiet && exit 0
git commit -m "update coverage report"
git push origin gh-pages
Loading