mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
ci: stop publishing the pnpm store from GitHub-hosted runners (#34588)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -185,9 +185,10 @@ runs:
|
||||
key: node-cache-${{ runner.os }}-${{ steps.pnpm-store.outputs.arch }}-pnpm-${{ hashFiles(inputs.cache-dependency-path) }}
|
||||
|
||||
# Producers can refresh access and publish misses without downloading existing archives.
|
||||
# Not on GitHub-hosted runners: nothing restores that store, and direct installs beat restoring it.
|
||||
- name: Keep pnpm download store without restoring
|
||||
id: pnpm-store-lookup
|
||||
if: steps.pnpm-store-mode.outputs.lookup-only == 'true'
|
||||
if: steps.pnpm-store-mode.outputs.lookup-only == 'true' && runner.environment != 'github-hosted'
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
# Twice-nested composite cleanup loses internal step outputs.
|
||||
|
||||
@@ -81,7 +81,9 @@ describe('CI dependency download caches', () => {
|
||||
const restore = action.runs.steps.find((step) => step.id === 'pnpm-store-restore')
|
||||
expect(action.inputs['cache-pnpm-store-lookup-only'].default).toBe('auto')
|
||||
expect(lookup.uses).toBe('actions/cache@v5')
|
||||
expect(lookup.if).toBe("steps.pnpm-store-mode.outputs.lookup-only == 'true'")
|
||||
expect(lookup.if).toBe(
|
||||
"steps.pnpm-store-mode.outputs.lookup-only == 'true' && runner.environment != 'github-hosted'"
|
||||
)
|
||||
expect(lookup.with).toEqual({
|
||||
path: '${{ env.ORCA_PNPM_STORE_CACHE_PATH }}',
|
||||
key: restore.with.key,
|
||||
|
||||
@@ -76,9 +76,10 @@ describe('automatic pnpm store mode', () => {
|
||||
)
|
||||
const nodeSetup = action.runs.steps.find((step) => step.id === 'default-node')
|
||||
expect(evaluate(nodeSetup.with.cache.slice(3, -2))).toBe(cache)
|
||||
expect(evaluate(action.runs.steps.find((step) => step.id === 'pnpm-store-lookup').if)).toBe(
|
||||
lookup
|
||||
)
|
||||
const publish = action.runs.steps.find((step) => step.id === 'pnpm-store-lookup').if
|
||||
expect(evaluate(publish)).toBe(false)
|
||||
context.runner.environment = 'self-hosted'
|
||||
expect(evaluate(publish)).toBe(lookup)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user