Skip to content
Closed
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
9 changes: 6 additions & 3 deletions .github/actions/provider-ci-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ runs:
# Dependency clones for a cold build; the lane's own build cache already
# holds them when it is restored.
- name: Restore SwiftPM repositories
if: env.CI_ACTIONS_CACHE != 'off'
id: spm-repos
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
Expand All @@ -87,6 +88,7 @@ runs:
# The build steps build once more from nothing if a looser entry fails.
# strict-cache (master) keeps only the first tier.
- name: Restore lane-specific Swift test build
if: env.CI_ACTIONS_CACHE != 'off'
id: swift-cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
Expand Down Expand Up @@ -141,20 +143,21 @@ runs:
# Only callers' trusted pushes save (save-caches): a pull request's entry
# is scoped to its merge ref, where nothing else restores it.
- name: Save lane-specific Swift test build
if: ${{ !cancelled() && inputs.save-caches == 'true' && steps.timestamps.outcome == 'success' && steps.swift-cache.outputs.cache-hit != 'true' }}
if: ${{ env.CI_ACTIONS_CACHE != 'off' && !cancelled() && inputs.save-caches == 'true' && steps.timestamps.outcome == 'success' && steps.swift-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
provider-swift/.build
libs/darkbloom-cluster/.build
key: ${{ steps.build-key.outputs.key }}
- name: Save SwiftPM repositories
if: ${{ !cancelled() && inputs.save-caches == 'true' && steps.timestamps.outcome == 'success' && steps.spm-repos.outputs.cache-hit != 'true' }}
if: ${{ env.CI_ACTIONS_CACHE != 'off' && !cancelled() && inputs.save-caches == 'true' && steps.timestamps.outcome == 'success' && steps.spm-repos.outputs.cache-hit != 'true' }}
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: /private/tmp/dinf-ci/swiftpm-repositories
key: ${{ steps.spm-repos.outputs.cache-primary-key }}
- name: Restore source-matched Metal cache
if: env.CI_ACTIONS_CACHE != 'off'
id: metallib-cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
Expand All @@ -175,7 +178,7 @@ runs:
bin=$(swift build --package-path "$package" --show-bin-path)
./scripts/stage-test-metallib.sh "$bin"
- name: Save validated source-matched Metal cache
if: ${{ !cancelled() && inputs.save-caches == 'true' && steps.metallib.outcome == 'success' && steps.metallib-cache.outputs.cache-hit != 'true' }}
if: ${{ env.CI_ACTIONS_CACHE != 'off' && !cancelled() && inputs.save-caches == 'true' && steps.metallib.outcome == 'success' && steps.metallib-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: /private/tmp/dinf-ci/metallib-cache
Expand Down
10 changes: 6 additions & 4 deletions .github/actions/provider-release-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ runs:
LANE: ${{ inputs.lane }}
run: python3 scripts/provider-release-cache.py keys --lane "$LANE" >> "$GITHUB_OUTPUT"
- name: Restore SDK-specific Swift build cache
if: env.CI_ACTIONS_CACHE != 'off'
id: swift-cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
Expand Down Expand Up @@ -161,6 +162,7 @@ runs:
echo "key=metallib-helper-v3-${MLX_SHA}-${HELPER_SHA}-${METAL_SHA}-${CMAKE_SHA}-${XCODE}-sdk${SDK}-dt${MLX_METALLIB_DEPLOYMENT_TARGET}-jitoff" >> "$GITHUB_OUTPUT"
echo "mlx_sha_short=${MLX_SHA:0:12}" >> "$GITHUB_OUTPUT"
- name: Restore source-matched metallib cache
if: env.CI_ACTIONS_CACHE != 'off'
id: metallib-cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
Expand All @@ -180,7 +182,7 @@ runs:
test -s "$RUNNER_TEMP/metallib/mlx.metallib"
echo "metallib=$RUNNER_TEMP/metallib/mlx.metallib" >> "$GITHUB_OUTPUT"
- name: Save source-matched metallib cache
if: steps.metallib-cache.outputs.cache-hit != 'true'
if: env.CI_ACTIONS_CACHE != 'off' && steps.metallib-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ${{ runner.temp }}/metallib-cache
Expand Down Expand Up @@ -258,7 +260,7 @@ runs:
--diagnostic-after-seconds 900 --timeout-seconds 1800 \
-- ../scripts/run-provider-tests.sh
- name: Restore pinned MiMo audio codec
if: inputs.lane == 'qualification' && steps.lane.outputs.last == 'true'
if: env.CI_ACTIONS_CACHE != 'off' && inputs.lane == 'qualification' && steps.lane.outputs.last == 'true'
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57
id: mimo-audio-cache
with:
Expand All @@ -270,7 +272,7 @@ runs:
shell: bash
run: python3 scripts/prepare-mimo-audio-fixtures.py --cache "$RUNNER_TEMP/mimo-audio-source" --output "$RUNNER_TEMP/mimo-audio-fixtures" --github-env "$GITHUB_ENV"
- name: Cache verified MiMo audio codec
if: inputs.lane == 'qualification' && steps.lane.outputs.last == 'true' && steps.mimo-audio-fixtures.outcome == 'success' && steps.mimo-audio-cache.outputs.cache-hit != 'true'
if: env.CI_ACTIONS_CACHE != 'off' && inputs.lane == 'qualification' && steps.lane.outputs.last == 'true' && steps.mimo-audio-fixtures.outcome == 'success' && steps.mimo-audio-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: ${{ runner.temp }}/mimo-audio-source
Expand Down Expand Up @@ -387,7 +389,7 @@ runs:
shell: bash
run: python3 scripts/provider-release-cache.py snapshot-mtimes
- name: Save SDK-specific Swift build cache
if: always() && !cancelled() && steps.timestamps.outcome == 'success' && steps.swift-cache.outputs.cache-hit != 'true'
if: env.CI_ACTIONS_CACHE != 'off' && always() && !cancelled() && steps.timestamps.outcome == 'success' && steps.swift-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: |
Expand Down
91 changes: 79 additions & 12 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,23 @@ jobs:
runs-on: ${{ fromJSON(needs.plan.outputs.routes)['release-integrity'] }}
timeout-minutes: 30
steps:
# Before every cache step: a Darkbloom Sandbox that the plane gave no
# Darkbloom cache would reach GitHub's own Actions cache, so there every
# cache step is skipped (docs/developer/build.md#ci-caching).
- name: Choose this job's Actions cache
run: |
if [[ ${RUNNER_NAME:-} != darkbloom-* ]]; then
echo "Actions cache: this runner's own"
elif [[ -n ${DARKBLOOM_CACHE_URL:-} ]]; then
echo "Actions cache: the Darkbloom cache at $DARKBLOOM_CACHE_URL"
else
echo "CI_ACTIONS_CACHE=off" >> "$GITHUB_ENV"
echo "::notice title=Actions cache::The plane gave this Darkbloom Sandbox no cache, so every cache step is skipped."
fi
# Every checkout in this workflow uses the same five steps: restore the
# newest .git a push saved, discard it unless git fsck accepts it, check
# out, and save .git once a day per branch (docs/developer/build.md#ci-caching).
# newest .git a push saved, discard it unless it can run nothing and git
# fsck accepts it, check out, and save .git once a day per branch
# (docs/developer/build.md#ci-caching).
- name: Select today's .git cache
id: git-day
run: |
Expand All @@ -85,6 +99,7 @@ jobs:
echo "month=${day%-*}" >> "$GITHUB_OUTPUT"
echo "actions/cache compressor: $(command -v zstd >/dev/null && echo zstd || echo gzip)"
- name: Restore the newest saved .git
if: env.CI_ACTIONS_CACHE != 'off'
id: git-cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
Expand All @@ -93,20 +108,39 @@ jobs:
restore-keys: |
git-v1-${{ runner.os }}-${{ steps.git-day.outputs.month }}-
git-v1-${{ runner.os }}-
- name: Discard a damaged cached .git
- name: Discard a damaged or unsafe cached .git
run: |
if [ -d .git ] && ! { git rev-parse --verify -q HEAD >/dev/null &&
[ -e .git ] || [ -L .git ] || exit 0
# Checked before git reads it: a restored .git must be a directory
# that runs nothing. No symbolic link, no hook but git's samples (here
# or in a submodule) and no config that sets a hook directory or a
# file system monitor or includes another file; git config --file
# only parses. Names ignore case, as macOS does.
if [ -L .git ] || [ ! -d .git ]; then
reason="it is not a directory"
elif [ -n "$(find .git -type l 2>/dev/null || true)" ]; then
reason="it holds a symbolic link"
elif [ -n "$(find .git -ipath '*/hooks/*' ! -type d ! -iname '*.sample' 2>/dev/null || true)" ]; then
reason="it holds a hook"
elif [ -n "$(find .git \( -iname config -o -iname config.worktree \) ! -type d \
-exec git config --file {} --name-only --list \; 2>/dev/null |
grep -i -E '^(core\.(fsmonitor|hookspath)|include\.|includeif\.)' || true)" ]; then
reason="its config sets core.fsmonitor, core.hooksPath or an include"
elif ! { git rev-parse --verify -q HEAD >/dev/null &&
git fsck --connectivity-only --no-progress >/dev/null 2>&1; }; then
echo "::warning title=.git cache::git fsck rejected the restored .git; checking out without it."
rm -rf .git
reason="git fsck rejected it"
else
exit 0
fi
echo "::warning title=.git cache::Discarded the restored .git ($reason); checking out without it."
rm -rf .git
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false # Keeps the job token out of the saved .git/config.
sparse-checkout: ${{ env.CHECKOUT_SPARSE }}
sparse-checkout-cone-mode: false
- name: Save .git for later runs
if: env.SAVE_CACHES == 'true' && steps.git-cache.outputs.cache-hit != 'true'
if: env.CI_ACTIONS_CACHE != 'off' && env.SAVE_CACHES == 'true' && steps.git-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: .git
Expand Down Expand Up @@ -190,6 +224,19 @@ jobs:
# Full-history checkouts of this repository have taken up to 21 minutes.
timeout-minutes: 45
steps:
# Before every cache step: a Darkbloom Sandbox that the plane gave no
# Darkbloom cache would reach GitHub's own Actions cache, so there every
# cache step is skipped (docs/developer/build.md#ci-caching).
- name: Choose this job's Actions cache
run: |
if [[ ${RUNNER_NAME:-} != darkbloom-* ]]; then
echo "Actions cache: this runner's own"
elif [[ -n ${DARKBLOOM_CACHE_URL:-} ]]; then
echo "Actions cache: the Darkbloom cache at $DARKBLOOM_CACHE_URL"
else
echo "CI_ACTIONS_CACHE=off" >> "$GITHUB_ENV"
echo "::notice title=Actions cache::The plane gave this Darkbloom Sandbox no cache, so every cache step is skipped."
fi
- name: Select today's .git cache
id: git-day
run: |
Expand All @@ -199,6 +246,7 @@ jobs:
echo "actions/cache compressor: $(command -v zstd >/dev/null && echo zstd || echo gzip)"
# Full history: a separate key family, so shallow jobs never restore it.
- name: Restore the newest saved .git
if: env.CI_ACTIONS_CACHE != 'off'
id: git-cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
Expand All @@ -207,20 +255,39 @@ jobs:
restore-keys: |
git-full-v1-${{ runner.os }}-${{ steps.git-day.outputs.month }}-
git-full-v1-${{ runner.os }}-
- name: Discard a damaged cached .git
- name: Discard a damaged or unsafe cached .git
run: |
if [ -d .git ] && ! { git rev-parse --verify -q HEAD >/dev/null &&
[ -e .git ] || [ -L .git ] || exit 0
# Checked before git reads it: a restored .git must be a directory
# that runs nothing. No symbolic link, no hook but git's samples (here
# or in a submodule) and no config that sets a hook directory or a
# file system monitor or includes another file; git config --file
# only parses. Names ignore case, as macOS does.
if [ -L .git ] || [ ! -d .git ]; then
reason="it is not a directory"
elif [ -n "$(find .git -type l 2>/dev/null || true)" ]; then
reason="it holds a symbolic link"
elif [ -n "$(find .git -ipath '*/hooks/*' ! -type d ! -iname '*.sample' 2>/dev/null || true)" ]; then
reason="it holds a hook"
elif [ -n "$(find .git \( -iname config -o -iname config.worktree \) ! -type d \
-exec git config --file {} --name-only --list \; 2>/dev/null |
grep -i -E '^(core\.(fsmonitor|hookspath)|include\.|includeif\.)' || true)" ]; then
reason="its config sets core.fsmonitor, core.hooksPath or an include"
elif ! { git rev-parse --verify -q HEAD >/dev/null &&
git fsck --connectivity-only --no-progress >/dev/null 2>&1; }; then
echo "::warning title=.git cache::git fsck rejected the restored .git; checking out without it."
rm -rf .git
reason="git fsck rejected it"
else
exit 0
fi
echo "::warning title=.git cache::Discarded the restored .git ($reason); checking out without it."
rm -rf .git
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # Frozen source links require committed document provenance.
filter: blob:none # Old file contents are fetched only when read.
persist-credentials: false
- name: Save .git for later runs
if: env.SAVE_CACHES == 'true' && steps.git-cache.outputs.cache-hit != 'true'
if: env.CI_ACTIONS_CACHE != 'off' && env.SAVE_CACHES == 'true' && steps.git-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: .git
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@ jobs:
runs-on: ${{ fromJSON(needs.route.outputs.routes)['frontend'] }}
timeout-minutes: 30
steps:
# Before every cache step: a Darkbloom Sandbox that the plane gave no
# Darkbloom cache would reach GitHub's own Actions cache, so there every
# cache step is skipped (docs/developer/build.md#ci-caching).
- name: Choose this job's Actions cache
run: |
if [[ ${RUNNER_NAME:-} != darkbloom-* ]]; then
echo "Actions cache: this runner's own"
elif [[ -n ${DARKBLOOM_CACHE_URL:-} ]]; then
echo "Actions cache: the Darkbloom cache at $DARKBLOOM_CACHE_URL"
else
echo "CI_ACTIONS_CACHE=off" >> "$GITHUB_ENV"
echo "::notice title=Actions cache::The plane gave this Darkbloom Sandbox no cache, so every cache step is skipped."
fi
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '22'
cache: npm
cache: ${{ env.CI_ACTIONS_CACHE != 'off' && 'npm' || '' }}
cache-dependency-path: desktop-app/package-lock.json
- run: npm ci
working-directory: desktop-app
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/landing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,23 @@ jobs:
working-directory: landing
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Before every cache step: a Darkbloom Sandbox that the plane gave no
# Darkbloom cache would reach GitHub's own Actions cache, so there every
# cache step is skipped (docs/developer/build.md#ci-caching).
- name: Choose this job's Actions cache
run: |
if [[ ${RUNNER_NAME:-} != darkbloom-* ]]; then
echo "Actions cache: this runner's own"
elif [[ -n ${DARKBLOOM_CACHE_URL:-} ]]; then
echo "Actions cache: the Darkbloom cache at $DARKBLOOM_CACHE_URL"
else
echo "CI_ACTIONS_CACHE=off" >> "$GITHUB_ENV"
echo "::notice title=Actions cache::The plane gave this Darkbloom Sandbox no cache, so every cache step is skipped."
fi
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'
cache: npm
cache: ${{ env.CI_ACTIONS_CACHE != 'off' && 'npm' || '' }}
cache-dependency-path: landing/package-lock.json
- run: npm ci
- run: npm run lint
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/provider-release-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ jobs:
# a Darkbloom Sandbox with another accepted SDK.
DARKBLOOM_PROVIDER_TOOLCHAIN: ${{ github.event_name == 'pull_request' && 'qualification' || 'release' }}
steps:
# Before every cache step: a Darkbloom Sandbox that the plane gave no
# Darkbloom cache would reach GitHub's own Actions cache, so there every
# cache step is skipped (docs/developer/build.md#ci-caching).
- name: Choose this job's Actions cache
run: |
if [[ ${RUNNER_NAME:-} != darkbloom-* ]]; then
echo "Actions cache: this runner's own"
elif [[ -n ${DARKBLOOM_CACHE_URL:-} ]]; then
echo "Actions cache: the Darkbloom cache at $DARKBLOOM_CACHE_URL"
else
echo "CI_ACTIONS_CACHE=off" >> "$GITHUB_ENV"
echo "::notice title=Actions cache::The plane gave this Darkbloom Sandbox no cache, so every cache step is skipped."
fi
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
submodules: recursive
Expand Down
Loading
Loading