From c4656998190259fec8516caf9c253687da38190e Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Wed, 22 Jul 2026 01:34:51 -0300 Subject: [PATCH] ci: skip drafts, schedule core workflows, expand addon smoke Skip test/lint/typecheck/shellcheck/markdownlint/scaffold jobs on draft PRs, run core checks twice daily, and matrix-test fastapi-starter with docker + github-setup addons across OSes (CNA parity). Closes #231 Closes #232 Closes #233 Co-authored-by: Cursor --- .github/workflows/lint.yml | 3 +++ .github/workflows/markdownlint.yml | 3 +++ .github/workflows/scaffold-cross-platform.yml | 24 +++++++++++++++---- .github/workflows/shellcheck.yml | 3 +++ .github/workflows/test.yml | 4 ++++ .github/workflows/type-check.yml | 3 +++ 6 files changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f15e9cf..d0ef70c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,9 +4,12 @@ on: branches: [main] pull_request: branches: [main] + schedule: + - cron: "31 1,12 * * *" workflow_dispatch: jobs: lint: + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index aaacb47..7e5b22b 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -4,9 +4,12 @@ on: branches: [main] pull_request: branches: [main] + schedule: + - cron: "31 1,12 * * *" workflow_dispatch: jobs: markdownlint: + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/scaffold-cross-platform.yml b/.github/workflows/scaffold-cross-platform.yml index ea92312..628006a 100644 --- a/.github/workflows/scaffold-cross-platform.yml +++ b/.github/workflows/scaffold-cross-platform.yml @@ -5,6 +5,9 @@ on: branches: [main] pull_request: branches: [main] + schedule: + # Monday 06:00 UTC (CNA parity) + - cron: "0 6 * * 1" workflow_dispatch: permissions: @@ -19,10 +22,12 @@ env: # After create-awesome-python-app>=0.2.0 ships resolve_catalog_spec, slugs also work. CPA_TEMPLATE_FASTAPI: https://github.com/Create-Python-App/cpa-templates?subdir=templates/fastapi-starter CPA_ADDON_DOCKER: https://github.com/Create-Python-App/cpa-templates?subdir=extensions/fastapi-docker + CPA_ADDON_GITHUB: https://github.com/Create-Python-App/cpa-templates?subdir=extensions/all-github-setup jobs: scaffold: name: ${{ matrix.os }} / fastapi-starter + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -72,22 +77,29 @@ jobs: PY addon-smoke: - name: ubuntu-latest / fastapi-starter + fastapi-docker - runs-on: ubuntu-latest + name: ${{ matrix.os }} / fastapi-starter + docker + github-setup + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: astral-sh/setup-uv@v7 - uses: actions/setup-python@v6 with: python-version: "3.12" - - name: Scaffold with one extension from PyPI CLI + - name: Scaffold with compatible addon combination env: - TARGET: ${{ runner.temp }}/cpa-fastapi-docker + TARGET: ${{ runner.temp }}/cpa-fastapi-addons + shell: bash run: | set -euo pipefail uvx create-awesome-python-app@latest \ --template "$CPA_TEMPLATE_FASTAPI" \ --addons "$CPA_ADDON_DOCKER" \ + --addons "$CPA_ADDON_GITHUB" \ --no-interactive \ --no-install \ --force \ @@ -95,8 +107,10 @@ jobs: - name: Verify extension files env: - TARGET: ${{ runner.temp }}/cpa-fastapi-docker + TARGET: ${{ runner.temp }}/cpa-fastapi-addons + shell: bash run: | set -euo pipefail test -f "$TARGET/Dockerfile" test -f "$TARGET/.dockerignore" + test -d "$TARGET/.github" diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 2532755..835b87a 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -4,9 +4,12 @@ on: branches: [main] pull_request: branches: [main] + schedule: + - cron: "31 1,12 * * *" workflow_dispatch: jobs: shellcheck: + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 923115c..edea34b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,9 +4,13 @@ on: branches: [main] pull_request: branches: [main] + schedule: + # Twice daily (CNA parity) — catch upstream/catalog regressions. + - cron: "31 1,12 * * *" workflow_dispatch: jobs: test: + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml index 5f73224..b285d64 100644 --- a/.github/workflows/type-check.yml +++ b/.github/workflows/type-check.yml @@ -4,9 +4,12 @@ on: branches: [main] pull_request: branches: [main] + schedule: + - cron: "31 1,12 * * *" workflow_dispatch: jobs: typecheck: + if: github.event_name != 'pull_request' || github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v7