-
Notifications
You must be signed in to change notification settings - Fork 1
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
zelalemshiferaw
committed
May 12, 2024
1 parent
ed62c7b
commit d0d9e07
Showing
1 changed file
with
17 additions
and
60 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 |
---|---|---|
@@ -1,76 +1,33 @@ | ||
# This workflow will install Python dependencies, run tests, and check the coverage | ||
|
||
name: Test with coverage | ||
name: Python application | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.10 | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-cov | ||
- name: Test with pytest | ||
python-version: "3.10" | ||
- name: Test Coverage | ||
run: | | ||
package_name="${{ env.PACKAGE_NAME }}" | ||
test_directory="${{ env.TEST_DIRECTORY }}" | ||
py.test -o junit_family=xunit2 --junitxml result.xml -v --ff --cov=$package_name --cov-report=xml --cov-report=term $test_directory | ||
env: | ||
PACKAGE_NAME: ${{ github.event.pull_request.head.repo.name }} | ||
TEST_DIRECTORY: "tests/" | ||
- name: Coverage Report | ||
if: always() | ||
uses: aGallea/[email protected] | ||
with: | ||
min-coverage-percentage: '100' | ||
fail-under-coverage-percentage: 'true' | ||
# cobertura-path: ./coverage.xml | ||
# junit-path: ./result.xml | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# name: Python application | ||
|
||
# on: | ||
# push: | ||
# branches: [ "master" ] | ||
# pull_request: | ||
# branches: [ "master" ] | ||
|
||
# permissions: | ||
# contents: read | ||
|
||
# jobs: | ||
# build: | ||
pip install pytest | ||
pip install coverage | ||
coverage run -m pytest | ||
coverage report | ||
coverage report --fail-under=80 | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Set up Python 3.10 | ||
# uses: actions/setup-python@v3 | ||
# with: | ||
# python-version: "3.10" | ||
# - name: Test Coverage | ||
# run: | | ||
# pip install pytest | ||
# pip install coverage | ||
# coverage run -m pytest | ||
# coverage report | ||
|