fix: add deactivation_reason to JobMissingFields #246
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: Run pytest on PRs | |
| on: | |
| pull_request_target: | |
| branches: | |
| - '**' | |
| types: [opened, synchronize, reopened, labeled] | |
| schedule: | |
| - cron: '0 2 * * 0' | |
| env: | |
| CI_LABEL: "ci-ok" | |
| 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 }} | |
| permissions: write-all | |
| jobs: | |
| check-run-approval: | |
| # Gate fork PRs behind the CI_LABEL | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Strip label on synchronize/reopen for labeled fork PRs" | |
| if: ${{ github.event_name == 'pull_request_target' && (github.event.action == 'synchronize' || github.event.action == 'reopened') && github.event.pull_request.head.repo.full_name != github.repository && contains(github.event.pull_request.labels.*.name, env.CI_LABEL) }} | |
| run: | | |
| echo "Synchronizing PR, removing '${{ env.CI_LABEL }}' label" | |
| gh pr edit ${{ github.event.pull_request.number }} --remove-label ${{ env.CI_LABEL }} --repo ${{ github.repository }} | |
| msg="All pull request updates require re-approval of CI. No CI will be run." | |
| echo "::error::$msg" | |
| exit 1 | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Require '${{ env.CI_LABEL }}' label on fork PRs" | |
| if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && !contains(github.event.pull_request.labels.*.name, env.CI_LABEL) }} | |
| run: | | |
| msg="Pull request is from a public fork but does not have the '${{ env.CI_LABEL }}' label. No CI will be run." | |
| echo "::error::$msg" | |
| exit 1 | |
| test: | |
| needs: check-run-approval | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # 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@1bdbba85fb74a2fdc1ec66383acec1091610f82b # MishaKav/pytest-coverage-comment@v1 | |
| with: | |
| pytest-coverage-path: ./pytest-coverage.txt | |
| title: Coverage Report | |
| badge-title: Coverage | |
| junitxml-path: ./coverage.xml |