Skip to content

Bugfix: Add PSPC platform type #163

Bugfix: Add PSPC platform type

Bugfix: Add PSPC platform type #163

name: code coverage
on:
push:
branches: "master"
pull_request:
branches: "master"
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Install dependencies and build package
run: |
poetry install
- name: Build coverage file
run: |
poetry run pytest --cov-config=.coveragerc --junitxml=pytest.xml --cov=psnawp_api | tee pytest-coverage.txt
env:
NPSSO_CODE: ${{ secrets.NPSSO_CODE }}
USER_NAME: ${{ secrets.USER_NAME }}
- name: PyTest Coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
hide-comment: true
badge-title: Coverage
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
- name: Create Variable of Summary Report
id: summary_report
run: |
SUMMARY_REPORT=${{ steps.coverageComment.outputs.summaryReport }}
echo "::set-output name=content::$SUMMARY_REPORT"
- name: Update Readme with Coverage Html
run: |
sed -i '/<!-- Pytest Coverage Comment:Begin -->/,/<!-- Pytest Coverage Comment:End -->/c\<!-- Pytest Coverage Comment:Begin -->\n\${{ steps.coverageComment.outputs.coverageHtml }}\n<!-- Pytest Coverage Comment:End -->' ./README.md
- name: Commit & Push changes to Readme
uses: actions-js/push@master
with:
branch: master
message: Update coverage on Readme
github_token: ${{ secrets.GITHUB_TOKEN }}