Skip to content

Merge pull request #15 from AlmaLinux/dependabot/pip/sentry-sdk-1.39.1 #33

Merge pull request #15 from AlmaLinux/dependabot/pip/sentry-sdk-1.39.1

Merge pull request #15 from AlmaLinux/dependabot/pip/sentry-sdk-1.39.1 #33

Workflow file for this run

name: pytest
on:
pull_request:
branches:
- "**"
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
name: Check out repository
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
files: |
**/*.py
- name: Prepare python env
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
python -m venv env
source env/bin/activate
pip install -U pip
pip install -r test-requirements.txt
- name: Run unit tests (pytest)
if: ${{ steps.changed-files.outputs.all_changed_files }}
run: bash -o pipefail -c 'source
env/bin/activate && pip3 install -r requirements.txt &&
pytest -vv --cov-report term-missing:skip-covered
--cov-report xml:/tmp/coverage.xml --junitxml=/tmp/pytest.xml --cov=alma_tests_cacher
tests/ | tee /tmp/pytest-coverage.txt'
- name: Pytest coverage comment
if: ${{ steps.changed-files.outputs.all_changed_files }}
uses: MishaKav/pytest-coverage-comment@main
id: coverageComment
with:
pytest-coverage-path: /tmp/pytest-coverage.txt
pytest-xml-coverage-path: /tmp/coverage.xml
title: Coverage report for changed files
badge-title: Total coverage
hide-badge: false
hide-report: false
report-only-changed-files: true
hide-comment: false
remove-link-from-badge: false
junitxml-path: /tmp/pytest.xml
- name: Create the Badge
if: ${{ github.ref == 'refs/heads/master' && steps.coverageComment.outputs.coverage }}
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 809b43cccaf8256b03fc0103e245eefc
filename: alma-tests-cacher-badge__main.json
label: Coverage Report
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python