add zizmor 🌈 workflow (#138)
Some checks failed
release / build (push) Failing after 18s
release / test (push) Has been skipped
zizmor 🌈 / zizmor latest via PyPI (push) Has been cancelled
lint / pre-commit (push) Has been cancelled
release / release (push) Has been cancelled

This commit is contained in:
Josh Thomas 2025-05-07 17:58:55 -05:00 committed by GitHub
parent 5997d9b87a
commit 0c041e20d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 78 additions and 11 deletions

View file

@ -31,13 +31,15 @@ jobs:
target: ppc64le target: ppc64le
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
with: with:
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --features extension-module args: --release --out dist --find-interpreter --features extension-module
@ -65,13 +67,15 @@ jobs:
target: armv7 target: armv7
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
with: with:
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --features extension-module args: --release --out dist --find-interpreter --features extension-module
@ -94,6 +98,8 @@ jobs:
target: x86 target: x86
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
@ -101,7 +107,7 @@ jobs:
architecture: ${{ matrix.platform.target }} architecture: ${{ matrix.platform.target }}
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
with: with:
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --features extension-module args: --release --out dist --find-interpreter --features extension-module
@ -124,13 +130,15 @@ jobs:
target: aarch64 target: aarch64
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
- name: Build wheels - name: Build wheels
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
with: with:
target: ${{ matrix.platform.target }} target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --features extension-module args: --release --out dist --find-interpreter --features extension-module
@ -146,9 +154,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build sdist - name: Build sdist
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
with: with:
command: sdist command: sdist
args: --out dist args: --out dist

View file

@ -23,9 +23,11 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with: with:
enable-cache: true enable-cache: true

View file

@ -50,7 +50,7 @@ jobs:
subject-path: "wheels-*/*" subject-path: "wheels-*/*"
- name: Publish to PyPI - name: Publish to PyPI
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
with: with:
command: upload command: upload
args: --non-interactive --skip-existing wheels-*/* args: --non-interactive --skip-existing wheels-*/*

View file

@ -26,22 +26,30 @@ env:
FORCE_COLOR: "1" FORCE_COLOR: "1"
PYTHONUNBUFFERED: "1" PYTHONUNBUFFERED: "1"
permissions: {}
jobs: jobs:
generate-matrix: generate-matrix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }} matrix: ${{ steps.set-matrix.outputs.matrix }}
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with: with:
enable-cache: true enable-cache: true
- id: set-matrix - id: set-matrix
env:
OS: ${{ inputs.os }}
run: | run: |
uv run noxfile.py --session gha_matrix -- "${{ inputs.os }}" uv run noxfile.py --session gha_matrix -- "${OS}"
test: test:
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (${{ matrix.os }}) name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (${{ matrix.os }})
@ -50,17 +58,24 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
permissions:
contents: read
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv - name: Install uv
uses: astral-sh/setup-uv@v6 uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with: with:
enable-cache: true enable-cache: true
- name: Run tests - name: Run tests
env:
DJANGO_VERSION: ${{ matrix.django-version }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: | run: |
uv run noxfile.py --session "tests(python='${{ matrix.python-version }}', django='${{ matrix.django-version }}')" uv run noxfile.py --session "tests(python='${PYTHON_VERSION}', django='${DJANGO_VERSION}')"
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest

36
.github/workflows/zizmor.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: zizmor 🌈
on:
push:
branches: [main]
pull_request:
branches: ["*"]
jobs:
zizmor:
name: zizmor latest via PyPI
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read # only needed for private repos
actions: read # only needed for private repos
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04
with:
enable-cache: true
- name: Run zizmor 🌈
run: uvx zizmor --format=sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: zizmor

View file

@ -17,6 +17,10 @@ repos:
- id: trailing-whitespace - id: trailing-whitespace
- id: no-commit-to-branch - id: no-commit-to-branch
args: ["--branch", "main"] args: ["--branch", "main"]
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.6.0
hooks:
- id: zizmor
- repo: local - repo: local
hooks: hooks:
- id: fmt - id: fmt