mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
GitHub warns that Node 20 actions are deprecated. checkout v6, cache (and cache/restore, cache/save) v5, setup-java v5, setup-node v6, upload-artifact v7, gradle setup-gradle v5 (v6 defaults to a proprietary cache provider). setup-swift has no Node 24 release yet: the DModemKit test uses the runner image's Swift instead (6.4 on ubuntu-24.04; the package needs tools 5.9). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRUAp3wTZAV7UCEiC4S
51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
# brew install with Homebrew's downloads cached (actions/cache): the
|
|
# bottles and its formula index (the API files), keyed on the runner image
|
|
# (ImageOS, ImageVersion) and the package list. No brew update (the slow,
|
|
# networked part; the image's Homebrew is recent enough), and with the
|
|
# index and bottles cached a hit downloads nothing. Retried, in case a
|
|
# download stalls.
|
|
name: brew packages
|
|
description: brew install, cached
|
|
inputs:
|
|
packages:
|
|
description: the formulae (spaces or newlines between)
|
|
required: true
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- id: key
|
|
shell: bash
|
|
env:
|
|
PKGS: ${{ inputs.packages }}
|
|
run: |
|
|
pkgs=$(printf '%s\n' $PKGS | sort -u | tr '\n' ' ')
|
|
echo "pkgs=$pkgs" >> "$GITHUB_OUTPUT"
|
|
# (ImageOS, ImageVersion: the runner's environment, not the env context)
|
|
echo "key=brew-${ImageOS:-none}-$RUNNER_ARCH-${ImageVersion:-none}-$(printf '%s' "$pkgs" | shasum -a 256 | cut -c1-16)" >> "$GITHUB_OUTPUT"
|
|
|
|
- id: restore
|
|
uses: actions/cache/restore@v5
|
|
with:
|
|
path: /tmp/brew-cache
|
|
key: ${{ steps.key.outputs.key }}
|
|
|
|
- shell: bash
|
|
env:
|
|
PKGS: ${{ steps.key.outputs.pkgs }}
|
|
HOMEBREW_CACHE: /tmp/brew-cache
|
|
HOMEBREW_NO_AUTO_UPDATE: '1'
|
|
HOMEBREW_NO_INSTALL_CLEANUP: '1'
|
|
HOMEBREW_NO_ENV_HINTS: '1'
|
|
HOMEBREW_CURL_RETRIES: '5'
|
|
run: |
|
|
set -euo pipefail
|
|
for i in 1 2 3; do brew install $PKGS && exit 0; sleep $((i * 10)); done
|
|
exit 1
|
|
|
|
- if: steps.restore.outputs.cache-hit != 'true'
|
|
uses: actions/cache/save@v5
|
|
continue-on-error: true
|
|
with:
|
|
path: /tmp/brew-cache
|
|
key: ${{ steps.restore.outputs.cache-primary-key }}
|