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
14 changes: 13 additions & 1 deletion .github/actions/prepare-git-compatibility/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ description: Restore or build the pinned Linux Git binary for the compatibility
runs:
using: composite
steps:
# Same scope as install-node-dependencies: a binary linked on a newer image's glibc fails on an older one.
- name: Resolve Git cache scope
id: git-cache-scope
shell: bash
run: |
scope="${ImageOS:-$RUNNER_OS}"
if [ -r /etc/os-release ]; then
. /etc/os-release
scope="${ID:-linux}-${VERSION_ID:-unknown}"
fi
echo "scope=$scope" >> "$GITHUB_OUTPUT"

# The default-branch warmer shares this key across PRs; a PR save is private to its merge ref.
# Cache eviction remains possible, so keep the checksum-verified cold build below.
- name: Cache baseline Git build
uses: actions/cache@v5
with:
path: ~/.cache/orca-git-compat/git-2.25.5
key: git-compat-baseline-${{ runner.os }}-${{ runner.arch }}-2.25.5
key: git-compat-baseline-${{ runner.os }}-${{ steps.git-cache-scope.outputs.scope }}-${{ runner.arch }}-2.25.5

# Finish the CPU-heavy build before any timed compatibility lanes start.
- name: Build the baseline Git binary
Expand Down
8 changes: 7 additions & 1 deletion config/scripts/git-binary-compatibility-workflow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ describe('Git binary compatibility PR gate', () => {
// in whichever boundary case is running rather than as a slow build.
expect(steps[matrixIndex].run).not.toContain('make -C')
expect(baselineSteps[cacheIndex].with.path).toBe(BASELINE_DIR)
// Why the OS release in the key: a baseline linked against a newer image's glibc
// fails to load on an older runner while ubuntu-latest rolls over gradually.
const scopeIndex = names.indexOf('Resolve Git cache scope')
expect(scopeIndex).toBeGreaterThanOrEqual(0)
expect(scopeIndex).toBeLessThan(cacheIndex)
expect(baselineSteps[scopeIndex].run).toContain('. /etc/os-release')
expect(baselineSteps[cacheIndex].with.key).toBe(
'git-compat-baseline-${{ runner.os }}-${{ runner.arch }}-2.25.5'
'git-compat-baseline-${{ runner.os }}-${{ steps.git-cache-scope.outputs.scope }}-${{ runner.arch }}-2.25.5'
)
})

Expand Down
Loading