Skip to content

Run pytest on PRs

Run pytest on PRs #82

Workflow file for this run

name: Run pytest on PRs
on:
pull_request_target:
branches:
- '**'
schedule:
- cron: '0 2 * * 0'
env:
DBT_BASE_URL: ${{ secrets.DBT_BASE_URL }}
DBT_API_KEY: ${{ secrets.DBT_API_KEY }}
DBT_JOB_ID: ${{ secrets.DBT_JOB_ID }}
DBT_ACCOUNT_ID: ${{ secrets.DBT_ACCOUNT_ID }}
DBT_PROJECT_ID: ${{ secrets.DBT_PROJECT_ID }}
DBT_ENV_ID: ${{ secrets.DBT_ENV_ID }}
jobs:
test:
if: |
github.event_name == 'schedule' ||
github.event.pull_request.head.repo.full_name == github.repository ||
contains(github.event.pull_request.labels.*.name, 'ci-ok')
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Run pytest (parallel)
if: matrix.python-version != '3.13'
run: make test-parallel
- name: Run pytest (full)
if: matrix.python-version == '3.13'
run: make test-full | tee pytest-coverage.txt && exit ${PIPESTATUS[0]}
- name: Pytest coverage comment
if: matrix.python-version == '3.13'
uses: MishaKav/pytest-coverage-comment@v1
with:
pytest-coverage-path: ./pytest-coverage.txt
title: Coverage Report
badge-title: Coverage
junitxml-path: ./coverage.xml