Merge pull request #28 from danielcristho/main #1
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: PyTest | ||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| paths: | ||
| - ".github/workflows/test.yml" | ||
| - "render_engine_api/**" | ||
| - "tests/**" | ||
| - "pyproject.toml" | ||
| - "requirements.txt" | ||
| jobs: | ||
| gen-coverage-badge: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: "3.14" | ||
| enable-cache: true | ||
| - name: run coverage and generate cov-report | ||
| run: | | ||
| uv run --dev pytest --cov-report xml | ||
| - name: genbadge coverage | ||
| run: | | ||
| uvx --with "genbadge[coverage]" genbadge coverage -i coverage.xml | ||
| - name: Commit Badge | ||
| uses: stefanzweifel/git-auto-commit-action@v7 | ||
| with: | ||
| commit_message: Update coverage badge [skip ci] | ||
| file_pattern: coverage.svg | ||
| test-against-python-matrix: | ||
| # Only test all the supported versions when a pull request is made or the workflow is called | ||
| if: ${{github.event_name == 'workflow_call'}} || ${{github.event_name == 'pull_request'}} | ||
|
Check warning on line 40 in .github/workflows/test.yml
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
| fail-fast: true | ||
| steps: | ||
| - uses: actions/checkout@v6.0.1 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| enable-cache: true # caching dependencies | ||
| - name: Run tests | ||
| run: | | ||
| uv run --dev pytest tests | ||
| test-against-latest-os: | ||
| # Always run against the latest version on both Windows, Linux, MacOS | ||
| if: github.event.pull_request.user.login != 'dependabot[bot]' | ||
| strategy: | ||
| matrix: | ||
| os: [windows-latest, macos-latest] | ||
| fail-fast: true | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v6.0.1 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: "3.14" | ||
| enable-cache: true # caching dependencies | ||
| - name: run tests | ||
| run: uv run --dev pytest tests | ||