| # Python nightly canary | |
| name: Python-Nightly-Canary | |
| # Exercises the "next" Python minor (currently 3.13 -- see the `next` | |
| # resolution in setup-backend/action.yml) against `master` on a schedule | |
| # instead of on every push. The Docker image's base Python is pinned via | |
| # PY_VER to the 3.11 line (see the Dockerfile); this canary is how we find | |
| # out the codebase and dependency tree are clean on the next minor before | |
| # that pin is ever moved, without paying for a second full Python version | |
| # on every push/PR. | |
| # | |
| # Runs the unit-test suite only, not the full integration matrix or | |
| # coverage gates -- this is a compatibility signal, not a release gate. | |
| permissions: | |
| contents: read | |
| on: | |
| schedule: | |
| # 05:00 UTC daily, so a 3.13 regression is known well before anyone | |
| # considers bumping PY_VER off 3.11. | |
| - cron: "0 5 * * *" | |
| # Manual trigger for on-demand runs (e.g. right after a dependency bump). | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests-next: | |
| # The nightly run reports to the upstream issue tracker; forks and | |
| # mirrors can still start it manually. | |
| if: github.event_name != 'schedule' || github.repository == 'apache/superset' | |
| runs-on: ubuntu-26.04 | |
| timeout-minutes: 45 | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| SQLALCHEMY_WARN_20: "1" | |
| steps: | |
| - name: "Checkout master (${{ github.sha }})" | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| submodules: recursive | |
| - name: Setup Python (next) | |
| uses: $/.github/actions/setup-backend/ | |
| with: | |
| python-version: next | |
| # Same suite as Python-Unit, whose babel_update.sh tests need gettext. | |
| - name: Install gettext tools | |
| uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3 | |
| with: | |
| packages: gettext | |
| version: 1.0 | |
| - name: Python unit tests | |
| env: | |
| SUPERSET_TESTENV: true | |
| SUPERSET_SECRET_KEY: not-a-secret | |
| run: | | |
| pytest --durations-min=0.5 --cov-report= --cov=superset ./tests/common ./tests/unit_tests --cache-clear --maxfail=50 | |
| # The whole point of this cron is finding 3.13 breakage before it's a | |
| # blocker on a real PY_VER bump, so a silent failure defeats the purpose -- | |
| # a red X in the Actions tab nobody is watching. Track it in one issue | |
| # that stays open across consecutive nightly failures (commenting on each | |
| # recurrence) instead of filing a fresh issue per failed run, which would | |
| # spam the issue board on a multi-night break. | |
| notify-on-failure: | |
| needs: unit-tests-next | |
| if: failure() | |
| runs-on: ubuntu-26.04 | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - name: Find or open the tracking issue | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPOSITORY: ${{ github.repository }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| TITLE="Python nightly canary (3.13) is failing" | |
| ISSUE_NUMBER=$(gh issue list \ | |
| --repo "$REPOSITORY" \ | |
| --search "\"$TITLE\" in:title" \ | |
| --state open \ | |
| --json number,title \ | |
| --jq ".[] | select(.title == \"$TITLE\") | .number" | head -1) | |
| if [ -n "$ISSUE_NUMBER" ]; then | |
| gh issue comment "$ISSUE_NUMBER" --repo "$REPOSITORY" \ | |
| --body "Still failing: ${RUN_URL}" | |
| else | |
| gh issue create \ | |
| --repo "$REPOSITORY" \ | |
| --title "$TITLE" \ | |
| --label "python" \ | |
| --body "The nightly Python-next (3.13) canary is failing against \`master\`. This tracks compatibility work ahead of bumping the base image's PY_VER off the 3.11 line. Further failures get commented here rather than filing new issues. | |
| Failed run: ${RUN_URL}" | |
| fi |