Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate test coverage when running tests #457

Merged
merged 7 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[report]
omit =
omit =
*/okonomiyaki/bundled/*
*/okonomiyaki/versions/pep386.py
*/tests/*

[run]
branch = True
source = okonomiyaki
relative_files = True
44 changes: 36 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,55 @@ jobs:
python-version: [3.6, 3.8]
os: [ubuntu-20.04, macos-11, windows-2019]
runs-on: ${{ matrix.os }}
needs: code-lint
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install okonomiyaki
run: python -m pip install .
run: python -m pip install -e .
- name: Install test dependencies
run: python -m pip install -r "dev_requirements.txt"
- name: Test with haas
run: |
cd tools
python -m haas okonomiyaki

coverage run -p -m haas okonomiyaki
- name: Upload Coverage info
uses: actions/upload-artifact@v4
with:
name: coverage-${{matrix.os}}-${{matrix.python-version}}
path: .coverage.*
coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Install coverage
run: pip install coverage
- name: Generate coverage report
run: |
pip install -e .
coverage combine
coverage report
coverage html
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/*
code-lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.6
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.6
- name: Install flake8
Expand Down