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: CI • Blocks Smoke | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| paths: | |
| - "api/**" | |
| - "tests/**" | |
| - "scripts/**" | |
| - "requirements/**" | |
| - ".github/workflows/ci-blocks.yml" | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| jobs: | |
| generate-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| blocks: ${{ steps.out.outputs.blocks }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Generate blocks matrix | |
| id: out | |
| run: | | |
| python scripts/gen_block_matrix.py --as-json > blocks.json || python scripts/gen_block_matrix.py > blocks.json | |
| echo "blocks=$(cat blocks.json)" >> $GITHUB_OUTPUT | |
| - name: Upload discovered blocks | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: discovered-blocks-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: blocks.json | |
| overwrite: true | |
| smoke: | |
| needs: [generate-matrix] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| # Blocks that are decorative or need external assets (don’t produce a PDF in smoke) | |
| DECORATIVE_BLOCKS: "avatar_circle,decor_curve,header_bar" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python: ["3.12", "3.13"] | |
| block: ${{ fromJson(needs.generate-matrix.outputs.blocks) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: "pip" | |
| - name: Install deps | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -r requirements/requirements.build.txt -c requirements/constraints.ci.txt | |
| python -m pip install pytest | |
| - name: Skip decorative/asset-dependent blocks | |
| if: ${{ contains(env.DECORATIVE_BLOCKS, matrix.block) }} | |
| run: echo "Skipping ${{ matrix.block }} (decorative or needs assets)." | |
| - name: Run block smoke (build PDF) | |
| if: ${{ !contains(env.DECORATIVE_BLOCKS, matrix.block) }} | |
| env: | |
| BLOCK_ID: ${{ matrix.block }} | |
| run: | | |
| pytest -q -k test_block_smoke -m view --disable-warnings | |
| - name: Upload PDFs | |
| if: ${{ !contains(env.DECORATIVE_BLOCKS, matrix.block) }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: blocks-smoke-${{ matrix.block }}-${{ matrix.os }}-py${{ matrix.python }}-${{ github.run_attempt }} | |
| path: out/*.pdf | |
| overwrite: true | |
| if-no-files-found: ignore | |
| - name: Pip debug | |
| if: failure() | |
| run: | | |
| pip debug --verbose || true | |
| pip check || true | |
| pip list || true |