-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add coverage and move test running to separate workflow yml
- Loading branch information
1 parent
f0f3336
commit e1c952f
Showing
6 changed files
with
159 additions
and
73 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
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,12 @@ | ||
name: Receive PR | ||
|
||
# read-only repo token | ||
# no access to secrets | ||
on: | ||
pull_request: | ||
# Sequence of patterns matched against refs/heads | ||
branches: [ feature/**, issue/**, issues/** ] | ||
|
||
jobs: | ||
build_and_test: | ||
uses: ./.github/workflows/reusable_run_tests.yml |
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
# This workflow will install Python dependencies, run tests, | ||
# and report test results and code coverage as artifacts. It will | ||
# be called by the workflow that runs tests against new PRs and as | ||
# a first step in the workflow that publishes new Docker images. | ||
|
||
name: A reusable workflow to build and run the unit test suite | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Set up Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.3.2 | ||
|
||
- name: Install ncompare | ||
run: poetry install | ||
|
||
- name: Lint | ||
run: | | ||
poetry run ruff ncompare | ||
- name: Run tests with coverage | ||
run: | | ||
poetry run coverage run -m pytest >& test_results.txt | ||
- name: Generate coverage report | ||
if: ${{ always() }} | ||
run: | | ||
poetry run coverage report -m >& coverage_report.txt | ||
poetry run coverage html --dir htmlcov | ||
- name: Archive test results | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test result | ||
path: test_results.txt | ||
|
||
- name: Archive code coverage report (plain text) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: code coverage report (plain text) | ||
path: coverage_report.txt | ||
|
||
- name: Archive code coverage report (HTML) | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: code coverage report (HTML) | ||
path: htmlcov/* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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