-
Notifications
You must be signed in to change notification settings - Fork 0
ci: extract skit.yml job prelude into a composite action (fixes #436) #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Was this helpful? React with 👍 or 👎 to provide feedback. Debug
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. Debug
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
|
|
@@ -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 | ||
|
|
@@ -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:: | ||
|
|
@@ -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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Was this helpful? React with 👍 or 👎 to provide feedback. Debug
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acknowledged — that was the explicit intent. The composite action's |
||
|
|
||
| - name: Install cargo-llvm-cov and cargo-nextest | ||
| uses: taiki-e/install-action@v2 | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
There was a problem hiding this comment.
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.mdrequires SPDX license headers on all new files, andAGENTS.mdexplicitly incorporates that requirement for agent-assisted changes. This PR adds.github/actions/setup-skit/action.ymlwithout the requiredSPDX-FileCopyrightTextandSPDX-License-Identifierheader, so the new file violates the repository's mandatory contribution rules.Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
Playground
There was a problem hiding this comment.
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
**/*.ymlaggregate annotation inREUSE.toml(REUSE ComplianceCI check is green on this PR). Added the explicit header in56a09e6so the newaction.ymlmatches the inline-header convention used bydocker.yml,docs.yml,e2e.yml,plugins.yml, andrelease.yml. (The pre-existingskit.yml,ui.yml,ci.ymlrely on the toml annotation — left those alone since they're out of scope here.)