Skip to content

Commit

Permalink
ott
Browse files Browse the repository at this point in the history
  • Loading branch information
zelalemshiferaw committed May 12, 2024
1 parent ed62c7b commit d0d9e07
Showing 1 changed file with 17 additions and 60 deletions.
77 changes: 17 additions & 60 deletions .github/workflows/python-app.yml
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
Expand Down

0 comments on commit d0d9e07

Please sign in to comment.