Repository navigation
build(deps): Bump markdown-exec from 1.12.6 to 1.13.0 #171
Workflow file for this run
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
| # Lint, type-check and test on every push and pull request. | |
| # | |
| # The package has no runtime dependencies, so the matrix is cheap: every | |
| # supported Python, the full test suite with the coverage floor from | |
| # pyproject.toml, and a wheel smoke test on one of them. poppler is | |
| # installed so the PDF tests run rather than skip. | |
| # | |
| # Test (Python X) ruff, mypy, pytest with coverage, the wheel, | |
| # and 30 seconds of the header fuzzer on one Python | |
| # Lockfile is current uv.lock matches pyproject.toml | |
| # Trivy scan HIGH/CRITICAL fixed vulnerabilities in what | |
| # uv.lock resolves | |
| # Security zizmor on the workflows, gitleaks on the | |
| # whole history | |
| # Shared templates are current cliff.toml and .githooks/commit-msg match | |
| # scattercode/release-pipelines | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test (Python ${{ matrix.python }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| # hatch-vcs derives the version from `git describe --tags`; a | |
| # shallow clone has no tags reachable and the package would | |
| # report 0.1.dev1+g<sha>. | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install poppler, for the PDF tests | |
| run: sudo apt-get update && sudo apt-get install -y --no-install-recommends poppler-utils | |
| - name: Install the package with the development extra | |
| run: pip install -e '.[dev]' | |
| - name: Lint | |
| run: | | |
| ruff check . | |
| ruff format --check . | |
| - name: Type-check | |
| run: mypy | |
| - name: Test | |
| run: pytest --cov --cov-report=term-missing | |
| # A short run of the header fuzzer on one Python: well-formed files | |
| # damaged at random, every outcome a verdict. The weekly run in | |
| # security.yml is the long one. The run id seeds it, so a failure | |
| # can be repeated with `--seed <run id>`; the id goes through the | |
| # environment, never into the script text. | |
| - name: Fuzz the header readers for 30 seconds | |
| if: matrix.python == '3.12' | |
| env: | |
| FUZZ_SEED: ${{ github.run_id }} | |
| run: python scripts/fuzz_headers.py --seconds 30 --seed "$FUZZ_SEED" | |
| # The wheel, not the editable install: catches files that work from | |
| # `pip install -e .` but were left out of the wheel. | |
| - name: Build and smoke-test the wheel | |
| if: matrix.python == '3.12' | |
| run: | | |
| pip install --quiet build twine | |
| python -m build | |
| twine check --strict dist/* | |
| python -m venv /tmp/smoke | |
| /tmp/smoke/bin/pip install --quiet dist/*.whl | |
| printf '%%!PS-Adobe-3.0 EPSF-3.0\n' > /tmp/page.png | |
| if /tmp/smoke/bin/sillybos /tmp/page.png; then echo "::error::a PostScript file passed"; exit 1; fi | |
| /tmp/smoke/bin/python -c "import sillybos; print(sillybos.__version__)" | |
| lockfile: | |
| name: Lockfile is current | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| # uv.lock pins the resolved development tooling so scanners see real | |
| # versions, not ranges. Regenerate with `uv lock` after any | |
| # pyproject.toml change. | |
| - uses: astral-sh/setup-uv@v7 | |
| - run: uv lock --check | |
| # Same arrangement as the sibling repositories. The committed uv.lock is | |
| # what makes the scan worthwhile for Python: pyproject.toml declares | |
| # ranges, but the lock carries every resolved version. | |
| trivy: | |
| name: Trivy scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Scan for vulnerabilities | |
| uses: aquasecurity/trivy-action@v0.36.0 | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| format: table | |
| exit-code: "1" | |
| ignore-unfixed: true | |
| vuln-type: library | |
| severity: HIGH,CRITICAL | |
| - name: Generate SBOM | |
| uses: aquasecurity/trivy-action@v0.36.0 | |
| if: always() | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| format: cyclonedx | |
| output: sbom.cdx.json | |
| exit-code: "0" | |
| - name: Upload SBOM | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: sbom-source-tree | |
| path: sbom.cdx.json | |
| retention-days: 90 | |
| # Static analysis of the workflows (zizmor: injection, unpinned actions, | |
| # over-broad permissions) and a scan of the whole history for secrets | |
| # (gitleaks). Both run before push and commit through lefthook too; this | |
| # is the backstop for a laptop without the hooks. | |
| security: | |
| name: Security | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Workflows | |
| run: uvx zizmor --min-severity medium .github/workflows | |
| # The gitleaks binary rather than gitleaks/gitleaks-action, which | |
| # needs a licence key (GITLEAKS_LICENSE) in a repository owned by an | |
| # organisation. Pinned to a release and its checksum. | |
| - name: Secrets in the history | |
| env: | |
| GITLEAKS_VERSION: 8.30.1 | |
| GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb | |
| run: | | |
| set -euo pipefail | |
| tarball="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" | |
| curl -fsSLO "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${tarball}" | |
| echo "${GITLEAKS_SHA256} ${tarball}" | sha256sum --check - | |
| tar -xzf "$tarball" gitleaks | |
| ./gitleaks git --no-banner --redact --verbose . | |
| # cliff.toml and .githooks/commit-msg are copies of the shared templates in | |
| # scattercode/release-pipelines. They have to be real files here -- git-cliff | |
| # reads one from the repository root and git runs the other from the checkout | |
| # -- so they cannot be referenced remotely the way the next-version action | |
| # is. This is what stops a copy drifting unnoticed. | |
| templates: | |
| name: Shared templates are current | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Check out the shared templates | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: scattercode/release-pipelines | |
| ref: v1 | |
| path: .release-pipelines | |
| persist-credentials: false | |
| - name: Compare | |
| run: ./.release-pipelines/sync.sh --check . |