Skip to content

Commit

Permalink
ci: zizmor fixes, add zizmor workflow (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
woodruffw authored Nov 24, 2024
1 parent 68d221d commit b09ce69
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ on:
jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Format
run: cargo fmt && git diff --exit-code

- name: Lint
run: |
rustup update
rustup component add clippy
cargo clippy -- -D warnings
test:
strategy:
matrix:
Expand All @@ -26,14 +32,17 @@ jobs:
- ubuntu-latest
- windows-latest
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
with:
Expand All @@ -30,6 +32,8 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
with:
Expand All @@ -54,6 +58,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-python@v5
with:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

jobs:
zizmor:
name: zizmor latest via Cargo
runs-on: ubuntu-latest
permissions:
security-events: write
# required for workflows in private repositories
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Get zizmor
run: cargo install zizmor
- name: Run zizmor 🌈
run: 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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ age = { version = "0.11", features = ["ssh", "plugin"] }
pyo3 = { version = "0.22.6", features = [
"extension-module",
"abi3",
"abi3-py38",
"abi3-py39",
"py-clone",
] }
pyo3-file = "0.9.0"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ classifiers = [
"Programming Language :: Rust",
"Operating System :: POSIX :: Linux",
]
requires-python = ">=3.8"
requires-python = ">=3.9"

0 comments on commit b09ce69

Please sign in to comment.