Update now article 28th Jan 2025 #40
Workflow file for this run
This file contains hidden or 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
| name: Test | |
| on: | |
| pull_request: {} | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| env: | |
| FLASK_APP: blog | |
| FLASK_ENV: development | |
| GITHUB_USERNAME: jamiefdhurst | |
| GITHUB_TOKEN: example | |
| jobs: | |
| Test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install -r requirements.txt | |
| - name: Test | |
| run: | | |
| coverage run --omit=tests/\* -m pytest --verbose --junit-xml tests.xml | |
| coverage xml -o coverage.xml | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v3 | |
| if: always() | |
| with: | |
| name: tests | |
| path: tests.xml | |
| - name: Upload Coverage | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: coverage | |
| path: coverage.xml | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| action_fail: true | |
| files: | | |
| tests.xml | |
| - name: Create Code Coverage Report | |
| uses: im-open/[email protected] | |
| with: | |
| reports: coverage.xml | |
| reporttypes: MarkdownSummary | |
| title: Pytest Code Coverage | |
| - name: Publish Code Coverage | |
| uses: im-open/[email protected] | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| summary-file: './coverage-results/Summary.md' | |
| check-name: 'Code Coverage' | |
| line-threshold: 80 | |
| # - name: Add Coverage PR Comment | |
| # uses: marocchino/sticky-pull-request-comment@v2 | |
| # if: always() | |
| # with: | |
| # recreate: true | |
| # path: code-coverage-results.md |