Skip to content

Merge pull request #28 from danielcristho/main #1

Merge pull request #28 from danielcristho/main

Merge pull request #28 from danielcristho/main #1

Workflow file for this run

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

View workflow run for this annotation

GitHub Actions / PyTest

Workflow syntax warning

.github/workflows/test.yml (Line: 40, Col: 9): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
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