set working-directory := '..' # Build and publish the development environment and @moq/libav to nix.moq.dev. cache: bash sh/gh/cache.sh # Publish Smoke's runtime packages and their build artifacts to nix.moq.dev. cache-runtime: bash sh/gh/cache-runtime.sh # Print the newest main commit whose Cache push run succeeded: its closures are all on nix.moq.dev. cache-rev: #!/usr/bin/env bash set -euo pipefail rev=$(gh run list --repo moq-dev/moq --workflow cache.yml --branch main --event push \ --status success --limit 1 --json headSha --jq '.[0].headSha // empty') if [[ -z "$rev" ]]; then echo "no successful Cache run found on main" >&2 exit 1 fi echo "$rev" # Keep the newest cached commit's closures on nix.moq.dev past the bucket's expiry. cache-refresh: #!/usr/bin/env bash set -euo pipefail rev=$(just gh cache-rev) just infra nix refresh nix-ci-moq-dev "$rev" # Build the runner image with a temporary policy on a disposable hosted runner. runner-vm-ci: #!/usr/bin/env bash set -euo pipefail if [[ "${GITHUB_ACTIONS:-}" != true || "${RUNNER_ENVIRONMENT:-}" != github-hosted ]]; then echo "runner-vm-ci requires a disposable GitHub-hosted runner" >&2 exit 1 fi profile="$(nix build --no-link --print-out-paths .#runner-userns-profile)" sudo apparmor_parser --add "$profile" trap 'sudo apparmor_parser --remove "$profile"' EXIT just gh runner-vm # Install the persistent host profile that lets Nix store unshare map user namespaces. runner-userns: #!/usr/bin/env bash set -euo pipefail if [[ "${GITHUB_ACTIONS:-}" == true ]]; then echo "runner-userns is persistent host policy; a hosted runner uses runner-vm-ci" >&2 exit 1 fi sudo install -m 0644 nix/runner/nix-builder-unshare /etc/apparmor.d/nix-builder-unshare sudo apparmor_parser --replace /etc/apparmor.d/nix-builder-unshare # Build and test the persistent NixOS runner VM on x86_64 Linux. runner-vm: bash sh/local.sh nix build --no-link .#checks.x86_64-linux.github-runner-vm .#checks.x86_64-linux.github-runner-vm-image .#checks.x86_64-linux.github-runner-vm-config --print-build-logs # Lint GitHub Actions workflows, their security, their alert coverage, that every step runs a recipe, and that every opt-in test has a caller. check: python3 sh/version.py actionlint zizmor --offline --quiet .github sh/gh/alert.sh check-coverage bun test ./sh/gh/alert.test.ts bun sh/gh/check-runs.ts python3 sh/gh/test-inventory.py python3 bench/relay.test.py # Repository tooling tests; run every ordinary test file whole in the merge gate. test: python3 sh/version.test.py python3 sh/local.test.py python3 test/smoke/runner.test.py python3 sh/coverage.test.py python3 sh/size/report.test.py python3 sh/size/release.test.py python3 sh/size/nightly.test.py python3 bench/compare.test.py python3 bench/summary.test.py python3 bench/profile.test.py python3 bench/fanout.test.py python3 bench/lock.test.py python3 bench/local.test.py python3 sh/gh/gst-formula.test.py python3 sh/changed.test.py python3 sh/large-files.test.py python3 sh/text.test.py python3 sh/dispatch-query.test.py python3 sh/gh/test-inventory.test.py bun test ./sh/gh/setup.test.ts bun sh/gh/queue.test.ts python3 sh/gh/install-formula.test.py sh/gh/release.test.sh python3 sh/gh/ffi.test.py bun test ./sh/gh/ffi.test.ts ./sh/gh/cpp.test.ts ./sh/gh/publish.test.ts python3 sh/rs/package-rename.test.py python3 sh/dart/build.test.py python3 sh/kt/gradle.test.py python3 sh/rs/select.test.py python3 sh/rs/config.test.py python3 sh/rs/hakari.test.py python3 sh/rs/test-lints.test.py python3 sh/js/install.test.py python3 sh/js/workspace.test.py python3 sh/js/audit.test.py python3 sh/gh/nightly.test.py python3 sh/gh/pages-clean.test.py python3 sh/gh/bench-report.test.py python3 sh/gh/rustc-cost.test.py python3 sh/gh/ts-paths.test.py sh/go/publish-wrapper.test.sh python3 sh/rs/uring.test.py # Tooling integration tests and selector timing, run nightly outside the merge gate. test-integration: bash sh/local.sh python3 bench/build.slow.test.py python3 sh/dispatch-query.test.py --bench # Release workflow helpers, e.g. `just gh release parse-version moq-cli`. [positional-arguments] release *args: sh/gh/release.sh "$@" # Post a failed run to Discord, or check cron and publishing alert coverage. [positional-arguments] alert *args: sh/gh/alert.sh "$@" # Render a Homebrew formula template for a release. [positional-arguments] formula *args: sh/gh/render-formula.sh "$@" # Copy a rendered formula into a Homebrew tap checkout, migrating renamed formulae. [positional-arguments] install-formula *args: python3 sh/gh/install-formula.py "$@" # Trigger the apt-repo and rpm-repo workflows for a release tag. [positional-arguments] trigger-repo-publish *args: sh/gh/trigger-repo-publish.sh "$@" # Measure a workflow run's release uploads, the minimal FFI build, and bundled first-load JS entries. size-collect output run="": sh/size/collect.sh '{{ output }}' '{{ run }}' # Compare a size report with its retained nightly history. [positional-arguments] size-report *args: python3 sh/size/report.py "$@" # Collect and compare nightly shipping sizes through the existing alert path. size-nightly output run: sh/size/nightly.sh '{{ output }}' '{{ run }}' # Install the rendered GStreamer formula against the current macOS tarball. [positional-arguments] gst-formula *args: python3 sh/gh/gst-formula.py "$@" # Run related Nightly benchmarks in one build environment, reporting every failure. nightly group: sh/gh/nightly.sh {{ quote(group) }} # Measure the merge gate's build and test cost, cold and after a moq-net edit, for the benchmark history. gate-cost: sh/gh/gate-cost.sh # Measure selected Criterion targets through the existing benchmark lifecycle. [positional-arguments] criterion *args: bench/run.sh --criterion "$@" # Convert, validate, and stage nightly benchmark history. [positional-arguments] benchmark-report *args: python3 sh/gh/bench-report.py "$@" # Select shared native artifacts or check an upstream FFI publisher. [positional-arguments] ffi *args: python3 sh/gh/ffi.py "$@" # Prepare the shared history branch or publish its regression table. [positional-arguments] benchmark-publish *args: sh/gh/bench-publish.sh "$@" # Commit a built report to gh-pages under one directory, leaving the branch checked out for the deploy. pages-publish directory report site: sh/gh/pages-publish.sh {{ quote(directory) }} {{ quote(report) }} {{ quote(site) }} # Delete this run's Pages artifact before uploading a replacement on a rerun. pages-clean: sh/gh/pages-clean.sh