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
1 change: 1 addition & 0 deletions .github/docker/ci-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ FROM mcr.microsoft.com/playwright:v1.61.1-noble AS runtime

ENV DEBIAN_FRONTEND=noninteractive \
PNPM_HOME=/pnpm \
COREPACK_HOME=/root/.cache/node/corepack \
PATH=/pnpm:$PATH

# --- System packages -------------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions .github/scripts/e2e-tests-workflow-contract_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
DOCKERFILE = REPO_ROOT / ".github" / "docker" / "ci-base" / "Dockerfile"
IMAGE_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "ci-base-image.yml"
E2E_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "e2e-tests.yml"
BACKEND_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "backend-tests.yml"
FRONTEND_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "frontend-tests.yml"
LINT_WORKFLOW = REPO_ROOT / ".github" / "workflows" / "lint-action-pinning.yml"
IMAGE_DIGEST_RESOLVER = REPO_ROOT / ".github" / "scripts" / "resolve-image-digest.sh"
VALID_IMAGE_INDEX = (
Expand Down Expand Up @@ -154,6 +156,18 @@ def test_image_workflow_publishes_desktop_tags(self) -> None:
self.assertIn("type=gha,scope=runtime", workflow)
self.assertIn("desktop-latest", workflow)

def test_container_jobs_use_the_baked_corepack_cache(self) -> None:
dockerfile = DOCKERFILE.read_text(encoding="utf-8")

self.assertIn("COREPACK_HOME=/root/.cache/node/corepack", dockerfile)
for workflow_path in (E2E_WORKFLOW, BACKEND_WORKFLOW, FRONTEND_WORKFLOW):
workflow = workflow_path.read_text(encoding="utf-8")
self.assertIn(
"COREPACK_HOME: /root/.cache/node/corepack",
workflow,
workflow_path.name,
)

def test_desktop_job_uses_image_without_live_bootstrap_downloads(self) -> None:
workflow = E2E_WORKFLOW.read_text(encoding="utf-8")
desktop_job = job_block(workflow, "desktop-e2e", "e2e-report")
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ permissions:
contents: read
packages: read

env:
# Container jobs may override HOME. Keep Corepack pointed at the pnpm cache
# prepared in the CI image.
COREPACK_HOME: /root/.cache/node/corepack

jobs:
runner_plan:
name: Plan external runner allocation
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ permissions:
# pull the kandev-ci image from GHCR via GITHUB_TOKEN.
packages: read

env:
# Container jobs may override HOME. Keep Corepack pointed at the pnpm cache
# prepared in the CI image so setup does not require an npm registry request.
COREPACK_HOME: /root/.cache/node/corepack

jobs:
runner_plan:
name: Plan external runner allocation
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ permissions:
contents: read
packages: read

env:
# Container jobs may override HOME. Keep Corepack pointed at the pnpm cache
# prepared in the CI image.
COREPACK_HOME: /root/.cache/node/corepack

jobs:
runner_plan:
name: Plan external runner allocation
Expand Down
Loading
Loading