Skip to content
Open
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
84 changes: 84 additions & 0 deletions .github/actions/setup-skit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# SPDX-FileCopyrightText: © 2025 StreamKit Contributors
#
# SPDX-License-Identifier: MPL-2.0

name: Set up Skit CI environment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 New composite action is missing the required SPDX header

CONTRIBUTING.md requires SPDX license headers on all new files, and AGENTS.md explicitly incorporates that requirement for agent-assisted changes. This PR adds .github/actions/setup-skit/action.yml without the required SPDX-FileCopyrightText and SPDX-License-Identifier header, so the new file violates the repository's mandatory contribution rules.

Suggested change
name: Set up Skit CI environment
# SPDX-FileCopyrightText: © 2025 StreamKit Contributors
#
# SPDX-License-Identifier: MPL-2.0
name: Set up Skit CI environment
Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the convention even though the file was already REUSE-compliant via the **/*.yml aggregate annotation in REUSE.toml (REUSE Compliance CI check is green on this PR). Added the explicit header in 56a09e6 so the new action.yml matches the inline-header convention used by docker.yml, docs.yml, e2e.yml, plugins.yml, and release.yml. (The pre-existing skit.yml, ui.yml, ci.yml rely on the toml annotation — left those alone since they're out of scope here.)

description: >
Common prelude for Skit CI jobs on ubuntu-22.04: free disk space, install
Bun and optionally build the UI (streamkit-server embeds ./ui/dist via
RustEmbed), install the system packages needed by the Rust build (libvpx,
nasm), install the pinned Rust toolchain, and restore Swatinem/rust-cache.
The caller must run actions/checkout before invoking this action so the
action.yml file is resolvable on the runner. sccache is intentionally not
part of the prelude — it is per-job and Coverage opts out entirely.

inputs:
rust-cache-key:
description: Swatinem/rust-cache shared-key. Jobs that share a target/ may share a key.
required: false
default: skit
rust-cache-workspaces:
description: >
Swatinem/rust-cache workspaces directive. Leave empty for the default
("."); set to e.g. ". -> target/coverage" when redirecting Cargo's
target dir (cargo-llvm-cov).
required: false
default: ""
rust-components:
description: >
Comma-separated extra Rust toolchain components to install (e.g.
"rustfmt, clippy" or "llvm-tools-preview"). Empty means none beyond
the default profile.
required: false
default: ""
skip-ui-build:
description: >
If "true", skip building ./ui/dist. streamkit-server's RustEmbed
directive requires ./ui/dist to exist at compile time, so most Rust
jobs need this false.
required: false
default: "false"
Comment on lines +34 to +40
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: The new skip-ui-build input is currently unused

The composite action adds a skip-ui-build input, but all current call sites in skit.yml use the default, so this PR does not actually change which Skit CI jobs build ./ui/dist. That matters because streamkit-server embeds ./ui/dist at compile time, so any future caller that sets this input will need to ensure it only runs Cargo commands that do not compile the embedding crate or otherwise creates ui/dist first.

Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, intentional — called out in the PR description as well. The issue (#436) proposed skip-ui-build because "Lint job doesn't need it", but in practice cargo clippy --workspace --all-targets does compile streamkit-server, which carries #[derive(RustEmbed)] #[folder = "../../ui/dist/"] (apps/skit/src/server/mod.rs:76-78) — RustEmbed needs the folder to exist at compile time, so Lint still needs the UI build. I kept the input as a future-proofing knob (so a follow-up that adds e.g. a cargo check -p streamkit-core-only job can flip it on) but no current caller sets it.


runs:
using: composite
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"

- name: Build UI
if: inputs.skip-ui-build != 'true'
working-directory: ./ui
shell: bash
run: |
bun install --frozen-lockfile
bun run build

- name: Install system dependencies (libvpx for VP9, nasm for AV1 assembly)
shell: bash
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
components: ${{ inputs.rust-components }}

- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ inputs.rust-cache-key }}
workspaces: ${{ inputs.rust-cache-workspaces }}
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true
Comment on lines +79 to +84
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Rust cache now runs before sccache is installed

The new composite action always invokes Swatinem/rust-cache as part of setup, but the reusable workflow still sets RUSTC_WRAPPER: sccache globally (.github/workflows/skit.yml:6-9) and only installs the sccache binary later in the lint/test/build jobs (.github/workflows/skit.yml:22-30, .github/workflows/skit.yml:65-73, .github/workflows/skit.yml:201-209). Those jobs now run rust-cache while Cargo/Rust tooling is configured to use a wrapper that is not on PATH yet, the exact failure mode the coverage job avoids by clearing RUSTC_WRAPPER before rust-cache (.github/workflows/skit.yml:94-101). As a result, the main CI lint/test/build jobs can fail during setup before reaching their cargo commands.

Prompt for agents
The `setup-skit` composite action currently runs `Swatinem/rust-cache` before the lint/test/build jobs install sccache, while those jobs inherit `RUSTC_WRAPPER=sccache` from `.github/workflows/skit.yml`. Move the rust-cache restore back to a point after `mozilla-actions/sccache-action` for jobs that use sccache, or otherwise ensure sccache is installed/on PATH before any rust-cache/Cargo/Rust tooling runs. Keep the coverage job's special handling intact because it intentionally clears `RUSTC_WRAPPER` and uses a separate coverage target directory/cache key.
Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — I tracked this one carefully before pushing. Believe this is a false positive; flagging the evidence so a human reviewer can decide whether to override:

  1. Swatinem/rust-cache does not consult RUSTC_WRAPPER. The action calls rustc -vV directly via @actions/exec to detect the toolchain version — that's a direct process spawn, and RUSTC_WRAPPER is a Cargo concept (Cargo prepends it when Cargo invokes rustc, not when the OS executes rustc as a top-level command). Likewise the action's cargo metadata --all-features does not need to compile anything; cargo metadata does not run rustc-via-wrapper for the dependency graph.

  2. CI confirms. This PR's first run (commit 9e4a018, before any further changes) finished with all four migrated jobs green: Skit / Lint (fmt + clippy) ✅, Skit / Test ✅, Skit / Coverage ✅, Skit / Build ✅. If rust-cache were tripping on the missing sccache binary during its setup, Lint/Test/Build would have failed at the rust-cache step, well before any cargo … command. The Coverage job's RUSTC_WRAPPER: "" override is for a different reason called out in the comment block at .github/workflows/skit.yml:94-101: instrumented Coverage builds don't cache usefully across PRs, and the workflow-level wrapper would otherwise route Coverage's cargo llvm-cov invocations through sccache (with sccache uninstalled in that job) — i.e. the override protects the cargo llvm-cov step, not the rust-cache step.

If a future change makes rust-cache start probing the wrapper (or you'd rather not rely on the above contract), the safe knob is to either move mozilla-actions/sccache-action into the composite (gated on a new skip-sccache input) or set env: RUSTC_WRAPPER: "" job-wide in the composite caller until after sccache is installed. Happy to switch to either if you'd prefer — let me know.

153 changes: 8 additions & 145 deletions .github/workflows/skit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,11 @@ jobs:
name: Lint (fmt + clippy)
runs-on: ubuntu-22.04
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false

- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- uses: ./.github/actions/setup-skit
with:
bun-version: "1.3.5"

- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build

- name: Install system dependencies (libvpx for VP9, nasm for AV1 assembly)
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
components: rustfmt, clippy
rust-components: "rustfmt, clippy"

- name: Restore sccache cache
uses: actions/cache/restore@v4
Expand All @@ -56,12 +29,6 @@ jobs:

- uses: mozilla-actions/sccache-action@v0.0.9

- uses: Swatinem/rust-cache@v2
with:
shared-key: skit
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true

- name: Check formatting
run: cargo fmt --all -- --check

Expand Down Expand Up @@ -91,37 +58,9 @@ jobs:
name: Test
runs-on: ubuntu-22.04
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false

- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"

- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build

- name: Install system dependencies (libvpx for VP9, nasm for AV1 assembly)
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
- uses: ./.github/actions/setup-skit

- name: Restore sccache cache
uses: actions/cache/restore@v4
Expand All @@ -133,12 +72,6 @@ jobs:

- uses: mozilla-actions/sccache-action@v0.0.9

- uses: Swatinem/rust-cache@v2
with:
shared-key: skit
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true

- name: Run tests (GPU tests run separately on self-hosted runner)
run: |
cargo test --locked --workspace -- --skip gpu_tests::
Expand Down Expand Up @@ -167,49 +100,13 @@ jobs:
# avoid the "sccache not installed" failure and unnecessary indirection.
RUSTC_WRAPPER: ""
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false

- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- uses: ./.github/actions/setup-skit
with:
bun-version: "1.3.5"

- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build

- name: Install system dependencies (libvpx for VP9, nasm for AV1 assembly)
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
components: llvm-tools-preview

- uses: Swatinem/rust-cache@v2
with:
shared-key: skit-coverage
# Point the cache at the same target dir we redirected Cargo to
# via CARGO_LLVM_COV_TARGET_DIR. Without this, rust-cache would
# cache the (empty) default target/ and skip the actual build
# artifacts under target/coverage.
workspaces: ". -> target/coverage"
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true
rust-cache-key: skit-coverage
rust-cache-workspaces: ". -> target/coverage"
rust-components: llvm-tools-preview
Comment on lines +105 to +109
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Coverage cache isolation is preserved by the refactor

The coverage job still passes the separate skit-coverage cache key and ". -> target/coverage" workspaces override into the composite action, while its job-level environment continues to clear RUSTC_WRAPPER. This preserves the previous intent of keeping instrumented coverage artifacts out of the normal shared rust-cache and avoiding sccache in coverage runs (.github/workflows/skit.yml:94-109).

Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — that was the explicit intent. The composite action's rust-cache-key and rust-cache-workspaces inputs were sized precisely to let Coverage keep its skit-coverage shared-key + . -> target/coverage redirect, and the job-level env: RUSTC_WRAPPER: "" override stays in skit.yml because the env behaviour is per-job, not part of the prelude.


- name: Install cargo-llvm-cov and cargo-nextest
uses: taiki-e/install-action@v2
Expand Down Expand Up @@ -297,37 +194,9 @@ jobs:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false

- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"

- name: Build UI
working-directory: ./ui
run: |
bun install --frozen-lockfile
bun run build

- name: Install system dependencies (libvpx for VP9, nasm for AV1 assembly)
run: sudo apt-get update && sudo apt-get install -y libvpx-dev nasm

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.95.0"
- uses: ./.github/actions/setup-skit

- name: Restore sccache cache
uses: actions/cache/restore@v4
Expand All @@ -339,12 +208,6 @@ jobs:

- uses: mozilla-actions/sccache-action@v0.0.9

- uses: Swatinem/rust-cache@v2
with:
shared-key: skit
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true

- name: Build all crates
run: |
cargo build --locked --workspace --release
Expand Down
Loading