Fix bug #48
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: Unit Tests with Codecov | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| run: | |
| name: Run unit tests with codecov upload | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| USING_COVERAGE: '3.12' | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.12"] | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --all-extras --dev --frozen | |
| - name: Run tests | |
| run: | | |
| git config --global user.name "Github Action" | |
| git config --global user.email "[email protected]" | |
| uv run pytest --cov=mkdocs_swagger_ui_tag --cov-report=xml -m "not e2e" | |
| - name: Upload coverage to Codecov | |
| if: "contains(env.USING_COVERAGE, matrix.python-version)" | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: false |