Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/actions/setup-ci-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ inputs:
description: Set to "false" when a concurrent job with the same install args saves the pnpm store
required: false
default: "true"
# Fork: GitHub-hosted macOS runners unpack the ~1 GB store tarball in 2.5-5 minutes, while a
# cold install from the registry takes about 30 seconds, so the fork's macOS release jobs skip it.
pnpm-store-cache:
description: Set to "false" to install from the registry without restoring or saving the pnpm store
required: false
default: "true"
runs:
using: composite
steps:
Expand Down Expand Up @@ -91,7 +97,7 @@ runs:
# against 9s plus an 11s restore.
- name: Restore pnpm store
id: pnpm_cache
if: inputs.install == 'true'
if: inputs.install == 'true' && inputs.pnpm-store-cache != 'false'
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pnpm_store.outputs.path }}
Expand Down Expand Up @@ -133,7 +139,7 @@ runs:
# compress the store for nothing; all but one pass save-pnpm-store: false.
- name: Save pnpm store
if: >-
inputs.install == 'true' && inputs.save-pnpm-store == 'true' &&
inputs.install == 'true' && inputs.save-pnpm-store == 'true' && inputs.pnpm-store-cache != 'false' &&
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
steps.pnpm_cache.outputs.cache-hit != 'true' &&
(steps.pnpm_store.outputs.namespace == 'full' ||
Expand Down
7 changes: 7 additions & 0 deletions .github/fork-manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ apps/mobile/src/features/threads/ThreadHeader.tsx icon: filesVisible ? "folder.f
.github/workflows/release-mobile-ios.yml T3CODE_IOS_PERSONAL_TEAM: "1"
.github/workflows/release-mobile-ios.yml key: ios-cas-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.xcode.outputs.build }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'patches/**') }}
.github/workflows/release-mobile-ios.yml name: Bound the compilation cache
.github/workflows/release-mobile-ios.yml pnpm-store-cache: "false"

# Fork: Hosted macOS release jobs install from the registry instead of unpacking the slow cached pnpm store.
.github/actions/setup-ci-deps/action.yml Fork:
.github/actions/setup-ci-deps/action.yml inputs.pnpm-store-cache != 'false'
.github/workflows/release-desktop.yml Fork:
.github/workflows/release-desktop.yml pnpm-store-cache: ${{ inputs.platform != 'mac' }}

# Fork: Keep fork opt-in releases, repository identity, hosted runner overrides, Intel macOS builds, and the unsigned iOS release dependency.
# Fork: Cut hosted macOS minutes: a configurable nightly gap, and macOS/iOS builds that wait for the release tests.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ jobs:
with:
install-args: --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
save-pnpm-store: ${{ inputs.save_pnpm_store }}
# Fork: hosted macOS installs faster from the registry than from the cached store.
pnpm-store-cache: ${{ inputs.platform != 'mac' }}
env:
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release-mobile-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
uses: ./.github/actions/setup-ci-deps
with:
install-args: --filter=@t3tools/mobile...
# Restoring the cached store took ~5 minutes on hosted macOS; installing takes under one.
pnpm-store-cache: "false"

# iOS accepts only up to three dot-separated integers, so drop any prerelease suffix.
- name: Resolve the app version
Expand Down Expand Up @@ -122,15 +124,16 @@ jobs:
ios-cas-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.xcode.outputs.build }}-

# Restoring across lockfiles keeps stale objects; start over before the saved entry crowds
# out the repository's other caches. An exact hit is never saved again, so it stays.
# out the repository's other caches. An exact hit is never saved again, so it stays. A cold
# build unpacks to ~4.2 GB (1.6 GB compressed), so the limit sits well above that.
- name: Bound the compilation cache
if: steps.ios_cas.outputs.cache-hit != 'true'
run: |
cas="$GITHUB_WORKSPACE/.ios-compilation-cache"
[ -d "$cas" ] || exit 0
size_mb=$(du -sm "$cas" | cut -f1)
echo "compilation cache: ${size_mb} MB"
if [ "$size_mb" -gt 3072 ]; then
if [ "$size_mb" -gt 8192 ]; then
echo "::notice::compilation cache is ${size_mb} MB; starting a fresh one"
rm -rf "$cas"
fi
Expand Down
2 changes: 1 addition & 1 deletion docs/operations/fork-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ but restore Xcode's content-addressed compilation cache for the same Xcode build
architecture. Entries are saved once per dependency change, not per commit, and a dependency change
restores the previous entry, so only the changed dependencies recompile. A per-commit key filled
the repository's 10 GB cache and evicted itself, turning ~13-minute builds into ~80-minute cold
ones. A restored cache over 3 GB is dropped so it cannot crowd out the other caches.
ones. A restored cache over 8 GB on disk (a cold build makes about 4.2 GB) is dropped so it cannot crowd out the other caches. The macOS release jobs install packages from the registry instead of the cached pnpm store, which took 2.5 to 5 minutes to unpack on hosted macOS against about 30 seconds to install.
The `mobile-ios-build-log` artifact includes compilation-cache diagnostics and Xcode task timings.

## Releases
Expand Down
Loading