Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Keeps the pinned dependencies fresh. Without this, SHA-pinned actions and the
# hash-pinned docs lockfile would silently rot — pinning trades automatic
# updates for reproducibility, and Dependabot is what pays that back.
#
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# GitHub Actions. Dependabot understands the `uses: owner/repo@<sha> # vX`
# convention and bumps both the SHA and the trailing comment, so the pins
# stay readable instead of decaying into opaque hashes.
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: ci

# Rust dependencies. Note the plugin pins `samp` to a git revision; Dependabot
# does not bump git dependencies, so that one stays a manual step (see the
# versioning section of CLAUDE.md).
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
commit-message:
prefix: deps

# MkDocs build dependencies. Docs-only, shipped in no artifact, but a
# vulnerable markdown extension still runs in CI.
- package-ecosystem: pip
directory: /docs
schedule:
interval: weekly
commit-message:
prefix: docs
14 changes: 9 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ on:
- 'docs/**'
- 'mkdocs.yml'
- 'docs/requirements.txt'
- 'docs/requirements.in'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'docs/requirements.txt'
- 'docs/requirements.in'
- '.github/workflows/docs.yml'
workflow_dispatch:

Expand All @@ -34,16 +36,18 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false

- uses: actions/setup-python@v6
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.x'
cache: pip
cache-dependency-path: docs/requirements.txt

- name: Install MkDocs and theme
run: pip install -r docs/requirements.txt
run: pip install --require-hashes -r docs/requirements.txt

- name: Strict build (fails on warnings)
run: mkdocs build --strict
Expand All @@ -52,7 +56,7 @@ jobs:
# a PR) can grab it. Uses the dedicated Pages artifact format.
- name: Upload Pages artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: site

Expand All @@ -72,4 +76,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
5 changes: 4 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on:
pull_request:
types: [opened, reopened, synchronize, labeled]

# Default: nothing. The single job opts into exactly what it needs.
permissions: {}

jobs:
update-release-draft:
runs-on: ubuntu-latest
permissions:
contents: write # create/update release draft
pull-requests: read # read PR titles and labels to generate the notes
steps:
- uses: release-drafter/release-drafter@v7
- uses: release-drafter/release-drafter@34d80673e067bdc0c24568d3af899c216adcfaa9 # v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0 # full history so the generate-notes API can list every commit
persist-credentials: false

- name: Verify Cargo.toml version matches release tag
run: |
Expand All @@ -37,8 +38,9 @@ jobs:
fi

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
targets: i686-unknown-linux-gnu,i686-pc-windows-msvc

- name: Install cross-compilation tools
Expand All @@ -50,7 +52,7 @@ jobs:
run: cargo install cargo-xwin --locked

- name: Cache cargo
uses: actions/cache@v5
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: |
~/.cargo/registry
Expand Down Expand Up @@ -135,7 +137,7 @@ jobs:
cat release_body.md

- name: Create GitHub Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
with:
name: ${{ github.ref_name }}
body_path: release_body.md
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false

- name: Install Rust (stable + clippy)
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
targets: i686-unknown-linux-gnu
components: clippy

Expand All @@ -33,7 +36,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib

- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- name: Build
run: cargo build --target i686-unknown-linux-gnu --verbose
Expand All @@ -50,10 +53,13 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- name: Install Rust (stable + rustfmt)
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check

Expand All @@ -68,8 +74,10 @@ jobs:
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v6
- uses: rustsec/audit-check@v2
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998 # v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -79,11 +87,14 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false

- name: Install Rust (stable + llvm-tools)
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
targets: i686-unknown-linux-gnu
components: llvm-tools-preview

Expand All @@ -92,16 +103,18 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib

- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
uses: taiki-e/install-action@cb33e69fad06166ca28a42b2575e4dadabf62ee8 # v2.85.8
with:
tool: cargo-llvm-cov

- name: Generate LCOV report
run: cargo llvm-cov --target i686-unknown-linux-gnu --lcov --output-path lcov.info

- name: Upload coverage artifact
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: coverage-lcov
path: lcov.info
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Scorecard

# Evaluates the repository's security posture (branch protection, pinned
# dependencies, token permissions, dangerous workflow patterns) and publishes
# the result to the OpenSSF dashboard.

on:
branch_protection_rule:
schedule:
- cron: '30 5 * * 1'
push:
branches: [master]
workflow_dispatch:

permissions: {}

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
security-events: write # upload the SARIF to code scanning
id-token: write # OIDC token for publish_results
contents: read

steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false

- name: Run analysis
uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
with:
results_file: results.sarif
results_format: sarif
publish_results: true

- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4
with:
sarif_file: results.sarif
Loading
Loading