Skip to content

ci(deps): bump the ci-actions group across 1 directory with 5 updates #208

ci(deps): bump the ci-actions group across 1 directory with 5 updates

ci(deps): bump the ci-actions group across 1 directory with 5 updates #208

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "LICENSE"
- "assets/**"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "LICENSE"
- "assets/**"
permissions: {}
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
jobs:
check:
name: Check
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- run: cargo check --workspace --all-targets --all-features --locked
fmt:
name: Format
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --component rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --component clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
test-rust:
name: Test Rust (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- run: cargo test --workspace --all-features --locked
build-wasm:
name: Build WASM
runs-on: ubuntu-latest
permissions:
contents: write # push updated core.wasm
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.ref_name }}
persist-credentials: true # needed for git push in commit step
# core.wasm is a build output of the Rust workspace. Rebuilding it on
# every run makes the unpinned stable toolchain push a new binary onto
# PRs that touched no Rust at all. Only rebuild when an input changed.
- name: Detect changes to core.wasm inputs
id: inputs
env:
BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
if [ -z "$BASE" ] || ! git fetch --no-tags --depth=1 origin "$BASE"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --quiet "$BASE" HEAD -- crates Cargo.toml Cargo.lock rust-toolchain rust-toolchain.toml go/ressrf/build_wasm.sh .github/workflows/ci.yml; then
echo "core.wasm inputs unchanged, skipping rebuild"
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.inputs.outputs.changed == 'true'
run: rustup toolchain install stable --profile minimal --target wasm32-wasip1
- if: steps.inputs.outputs.changed == 'true'
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: Install wasm-opt
if: steps.inputs.outputs.changed == 'true'
run: |
curl -fsSL https://github.com/WebAssembly/binaryen/releases/download/version_129/binaryen-version_129-x86_64-linux.tar.gz \
| sudo tar -xz -C /usr/local --strip-components=1
- name: Install wasm-tools
if: steps.inputs.outputs.changed == 'true'
run: cargo install wasm-tools --locked
- name: Rebuild core.wasm
if: steps.inputs.outputs.changed == 'true'
run: bash go/ressrf/build_wasm.sh
- name: Copy core.wasm to node/
if: steps.inputs.outputs.changed == 'true'
run: cp go/ressrf/core.wasm node/core.wasm
- name: Commit if changed
if: steps.inputs.outputs.changed == 'true'
run: |
if git diff --quiet go/ressrf/core.wasm node/core.wasm; then
echo "core.wasm is up to date"
else
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add go/ressrf/core.wasm node/core.wasm
git commit -m "chore: rebuild core.wasm [ci]"
git push
fi
test-go:
needs: [build-wasm]
name: Test Go (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.ref_name }}
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go/ressrf/go.mod
cache-dependency-path: go/ressrf/go.sum
- name: Test
working-directory: go/ressrf
run: go test -count=1 -race ./...
- name: Vet
working-directory: go/ressrf
run: go vet ./...
lint-go:
needs: [build-wasm]
name: Lint Go
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.ref_name }}
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go/ressrf/go.mod
cache-dependency-path: go/ressrf/go.sum
- uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: latest
working-directory: go/ressrf
test-python:
name: Test Python (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
enable-cache: true
cache-dependency-glob: python/uv.lock
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: python
- name: Install and test
working-directory: python
run: |
uv venv
uv pip install maturin pytest
uv run maturin develop
uv run pytest tests/ -v
lint-python:
name: Lint Python
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
- name: Ruff format check
working-directory: python
run: uvx ruff format --check .
- name: Ruff lint
working-directory: python
run: uvx ruff check .
- name: Type check (ty)
working-directory: python
run: uvx ty check
test-node:
needs: [build-wasm]
name: Test Node.js (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.ref_name }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"
cache: npm
cache-dependency-path: node/package-lock.json
- name: Install
working-directory: node
run: npm ci
- name: Test
working-directory: node
run: npx tsx --test tests/*.test.ts
lint-node:
needs: [build-wasm]
name: Lint Node.js
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.ref_name }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"
cache: npm
cache-dependency-path: node/package-lock.json
- name: Install
working-directory: node
run: npm ci
- name: Type check
working-directory: node
run: npx tsc --noEmit
e2e-tests:
name: SSRF E2E (Tier 2, Docker)
runs-on: ubuntu-latest
permissions:
contents: read # checkout
# Linux only because the regular GitHub-hosted macOS/Windows runners
# lack a Docker daemon. The Tier 2 SSRF tests spin up CoreDNS and
# WireMock containers via testcontainers-rs to verify DNS-based and
# redirect-based bypasses end-to-end. The `e2e` Cargo feature is
# off by default so the standard test-rust matrix above stays
# hermetic on macOS / Windows.
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Different feature set than the main test-rust job; cache key
# is namespaced so the e2e build artifacts do not pollute or
# invalidate the default-feature cache.
key: e2e
- name: Pre-pull container images
# Pulling up front avoids per-test pull races and surfaces
# registry / network failures as a single explicit step.
run: |
docker pull coredns/coredns:1.11.3
docker pull wiremock/wiremock:3.9.1
- name: Run Tier 2 e2e tests
run: cargo test --features e2e -p ressrf-tcp --test ssrf_e2e --locked
test-go-native:
# Native Go port at go-native/ressrf/. No WASM runtime, no Rust
# toolchain; depends on neither the build-wasm step nor the wazero
# binding.
name: Test Go native (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum
- name: Test
working-directory: go-native/ressrf
run: go test -count=1 -race ./...
- name: Vet
working-directory: go-native/ressrf
run: go vet ./...
lint-go-native:
name: Lint Go native
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum
- uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: latest
working-directory: go-native/ressrf
generated-up-to-date:
# Drift check: if a contributor edits crates/ressrf-core/config/*.json
# without re-running `go generate ./...` from the native Go module,
# the baked-in tables under go-native/ressrf/internal/engine/ go
# stale. `make check-generated` regenerates and fails on diff.
name: Generated Go files up to date
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum
- name: Check generated files
working-directory: go-native/ressrf
run: make check-generated