mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 16:24:38 +00:00
Pushes to main cancel the Workspace run they supersede, as pull requests already do; the newest push's run tests everything before it. On 16 Nov main had 144 pushes, each a three-OS run that could not be cancelled, which is much of what fills the org's macOS runners. Release tags, manual runs and a new scheduled run every 6 hours keep a group of their own and always finish, and the scheduled run saves the caches (the gate already saves on scheduled runs of the default branch). scripts/test-workspace-concurrency.py checks the new policy. The per-crate workflows, which no longer save caches, cancel superseded runs on every branch, main included.
78 lines
3.1 KiB
YAML
78 lines
3.1 KiB
YAML
name: Shared media
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths: ["crates/media/**", "crates/media-testkit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/media.yml"]
|
|
pull_request:
|
|
paths: ["crates/media/**", "crates/media-testkit/**", "Cargo.toml", "Cargo.lock", ".github/workflows/media.yml"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# A fraction of the fuzz-style cases, as in the Workspace gate; nightly.yml runs them in full.
|
|
env:
|
|
CRAFT_HOSTILE_DIVISOR: "8"
|
|
PROPTEST_CASES: "64"
|
|
|
|
concurrency:
|
|
# One group per pull request and per branch: a newer push cancels the run it supersedes, on main
|
|
# too, since the newest run checks everything before it.
|
|
group: shared-media-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
timeout-minutes: 10
|
|
# fmt, and clippy with default and with all features, run in the Workspace gate on every OS.
|
|
name: Media feature sets, WASM
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden runner
|
|
uses: step-security/harden-runner@v2.22.4
|
|
with:
|
|
egress-policy: audit
|
|
- uses: actions/checkout@v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: step-security/dtolnay-rust-toolchain@v1.0.0
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
targets: wasm32-unknown-unknown
|
|
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features -- -D warnings
|
|
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features --features bitstream -- -D warnings
|
|
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features --features matroska -- -D warnings
|
|
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features --features ogg -- -D warnings
|
|
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features --features serde -- -D warnings
|
|
- run: cargo check -p craft-media --all-features --locked --target wasm32-unknown-unknown
|
|
test:
|
|
timeout-minutes: 15
|
|
name: Media tests with ffmpeg oracles
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden runner
|
|
uses: step-security/harden-runner@v2.22.4
|
|
with:
|
|
egress-policy: audit
|
|
- uses: actions/checkout@v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- uses: step-security/dtolnay-rust-toolchain@v1.0.0
|
|
with:
|
|
toolchain: stable
|
|
- name: Build tests while installing ffmpeg
|
|
run: |
|
|
# The man-db index rebuild after dpkg is slow on hosted runners.
|
|
sudo rm -f /var/lib/man-db/auto-update
|
|
(sudo apt-get update -qq && sudo apt-get install -y -qq --no-install-recommends ffmpeg) > "$RUNNER_TEMP/apt.log" 2>&1 &
|
|
apt=$!
|
|
cargo test -p craft-media --all-features --locked --no-run
|
|
wait "$apt" || { cat "$RUNNER_TEMP/apt.log"; exit 1; }
|
|
ffmpeg -hide_banner -version | sed -n 1p
|
|
- run: cargo test -p craft-media --all-features --locked
|
|
env:
|
|
CRAFT_MEDIA_REQUIRE_ORACLES: "1"
|
|
CRAFT_MEDIA_FIXTURES_DIR: ${{ runner.temp }}/media-fixtures
|