-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e64a318
commit 7243b99
Showing
2 changed files
with
75 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '!main' | ||
pull_request: {} | ||
|
||
permissions: | ||
contents: read | ||
issues: read | ||
checks: write | ||
pull-requests: write | ||
|
||
env: | ||
FLASK_APP: blog | ||
FLASK_ENV: development | ||
GITHUB_USERNAME: jamiefdhurst | ||
GITHUB_TOKEN: example | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install pylint pytest requests-mock coverage | ||
python setup.py develop | ||
- name: Test | ||
run: | | ||
coverage run -m pytest --verbose --junit-xml tests.xml | ||
coverage xml -o coverage.xml | ||
- name: Upload Test Results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tests | ||
path: tests.xml | ||
- name: Upload Coverage | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage | ||
path: coverage.xml | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
action_fail: true | ||
files: | | ||
tests.xml | ||
- name: Publish Code Coverage | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage.xml | ||
badge: false | ||
fail_below_min: true | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '80 90' | ||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md |
This file was deleted.
Oops, something went wrong.