Skip to content

Commit f2ee787

Browse files
joshuarliJPeer264claude
authored
ci: run CI on GitHub-hosted runners again (#26057)
for now we're only doing this on private repos --------- Co-authored-by: JPeer264 <jan.peer@sentry.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 930a4c8 commit f2ee787

56 files changed

Lines changed: 261 additions & 316 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,30 @@
11
name: 'Install pnpm dependencies'
2-
description: 'Installs pnpm dependencies into node_modules folders on the Namespace cache volume.'
2+
description: 'Installs pnpm dependencies and caches them.'
3+
4+
outputs:
5+
cache_key:
6+
description: 'The dependency cache key'
7+
value: ${{ steps.compute_lockfile_hash.outputs.hash }}
38

49
runs:
510
using: 'composite'
611
steps:
7-
- name: List dependency paths
8-
id: paths
9-
run: |
10-
{
11-
echo 'paths<<EOF'
12-
node -e 'const { workspaces } = require("./package.json"); for (const dir of [".", ...workspaces]) console.log(require("path").resolve(dir, "node_modules"))'
13-
echo '~/.cache/mongodb-binaries'
14-
echo '~/.cache/prisma'
15-
echo 'EOF'
16-
} >> "$GITHUB_OUTPUT"
17-
shell: bash
18-
19-
- name: Mount dependency cache
20-
uses: ./.github/actions/mount-pnpm-store
21-
with:
22-
path: ${{ steps.paths.outputs.paths }}
23-
2412
- name: Install pnpm
2513
uses: ./.github/actions/install-pnpm
2614

27-
# When the node_modules layout changes, `pnpm install` keeps the `.bin` scripts of the workspace packages, which
28-
# then point into a folder that the new layout does not have. Branches that change `nodeLinker` share this cache
29-
# volume, so start from empty node_modules folders when the layout on the volume differs, or when an earlier
30-
# install already left such broken `.bin` scripts behind.
31-
- name: Remove node_modules of another layout
32-
run: |
33-
mapfile -t dirs < <(grep '/node_modules$' <<< "$DEPENDENCY_PATHS")
34-
expected=$(pnpm config get node-linker)
35-
if [[ "$expected" == undefined ]]; then
36-
expected=isolated
37-
fi
38-
actual=$(node -p 'try { JSON.parse(require("fs").readFileSync("node_modules/.modules.yaml", "utf8")).nodeLinker ?? "" } catch { "" }')
39-
if [[ -n "$actual" && "$actual" != "$expected" ]]; then
40-
reason="The node_modules folders use the $actual layout, but nodeLinker is $expected."
41-
else
42-
broken=$(node "$GITHUB_ACTION_PATH/find-broken-bin.mjs" "${dirs[@]}")
43-
if [[ -n "$broken" ]]; then
44-
reason="The target of $broken does not exist."
45-
fi
46-
fi
47-
if [[ -n "$reason" ]]; then
48-
echo "$reason Removing the node_modules folders."
49-
for dir in "${dirs[@]}"; do
50-
if [[ -d "$dir" ]]; then
51-
# The folders are mounted from the cache volume, so empty them instead of removing them
52-
find "$dir/" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
53-
fi
54-
done
55-
fi
56-
env:
57-
DEPENDENCY_PATHS: ${{ steps.paths.outputs.paths }}
15+
- name: Compute dependency cache key
16+
id: compute_lockfile_hash
17+
run: node ./scripts/dependency-hash-key.js >> "$GITHUB_OUTPUT"
5818
shell: bash
5919

60-
# The cache volume can hold node_modules of another commit or branch. This is a no-op when they match
61-
# pnpm-lock.yaml.
20+
- name: Check dependency cache
21+
uses: actions/cache@v6.1.0
22+
id: cache_dependencies
23+
with:
24+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
25+
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
26+
6227
- name: Install dependencies
28+
if: steps.cache_dependencies.outputs.cache-hit != 'true'
6329
run: pnpm install --frozen-lockfile
6430
shell: bash

‎.github/actions/install-dependencies/find-broken-bin.mjs‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎.github/actions/install-playwright/action.yml‎

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Install Playwright dependencies'
2-
description: 'Installs Playwright browsers and system dependencies, keeping both on the Namespace cache volume.'
2+
description: 'Installs Playwright dependencies and caches them.'
33
inputs:
44
browsers:
55
description: 'What browsers to install.'
@@ -26,28 +26,43 @@ runs:
2626
shell: bash
2727
working-directory: ${{ inputs.cwd }}
2828

29-
- name: Mount Playwright cache
30-
uses: namespacelabs/nscloud-cache-action@1124a6f3ce44e5cf84cc22111530961f4d2a15f9 # v1.7.0
29+
- name: Restore cached playwright binaries
30+
uses: actions/cache/restore@v6.1.0
31+
id: playwright-cache
3132
if: steps.playwright-version.outputs.version != ''
3233
with:
33-
cache: |
34-
playwright
35-
apt
34+
path: |
35+
~/.cache/ms-playwright
36+
# Bump the iteration when bumping runner images to use a new cache
37+
key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}
3638

37-
# `--with-deps` names packages that the runner image already has (glib, mesa, nss, ...), and `apt-get install` would
38-
# upgrade them to the latest Ubuntu update. That is half of the download on a cold cache, and the image versions work.
39-
- name: Keep installed apt packages
40-
if: steps.playwright-version.outputs.version != ''
41-
run: echo 'APT::Get::Upgrade "false";' | sudo tee /etc/apt/apt.conf.d/99-no-upgrade > /dev/null
39+
# We always install all browsers, if uncached
40+
# `npx` runs outside the repo, so it can't pick up a `playwright` that a parallel `pnpm install` is still linking.
41+
- name: Install Playwright dependencies (uncached)
42+
env:
43+
PLAYWRIGHT_VERSION: ${{ steps.playwright-version.outputs.version }}
44+
run: npx -y "playwright@$PLAYWRIGHT_VERSION" install chromium webkit firefox --with-deps
45+
if: steps.playwright-version.outputs.version != '' && steps.playwright-cache.outputs.cache-hit != 'true'
4246
shell: bash
47+
working-directory: ${{ runner.temp }}
4348

44-
# Downloads only the browsers and apt packages that are not on the cache volume yet. `npx` runs outside the repo,
45-
# so it can't pick up a `playwright` that a parallel `pnpm install` is still linking.
46-
- name: Install Playwright
47-
if: steps.playwright-version.outputs.version != ''
49+
- name: Install Playwright system dependencies only (cached)
4850
env:
4951
PLAYWRIGHT_BROWSERS: ${{ inputs.browsers || 'chromium webkit firefox' }}
5052
PLAYWRIGHT_VERSION: ${{ steps.playwright-version.outputs.version }}
51-
run: npx -y "playwright@$PLAYWRIGHT_VERSION" install --with-deps $PLAYWRIGHT_BROWSERS
53+
run: npx -y "playwright@$PLAYWRIGHT_VERSION" install-deps $PLAYWRIGHT_BROWSERS
54+
if: steps.playwright-version.outputs.version != '' && steps.playwright-cache.outputs.cache-hit == 'true'
5255
shell: bash
5356
working-directory: ${{ runner.temp }}
57+
58+
# Only store cache on develop branch
59+
- name: Store cached playwright binaries
60+
uses: actions/cache/save@v6.1.0
61+
if:
62+
steps.playwright-version.outputs.version != '' && github.event_name == 'push' && github.ref ==
63+
'refs/heads/develop'
64+
with:
65+
path: |
66+
~/.cache/ms-playwright
67+
# Bump the iteration when bumping runner images to use a new cache
68+
key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}

‎.github/actions/mount-pnpm-store/action.yml‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎.github/actions/prepare-e2e-test/action.yml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ runs:
4646
uses: denoland/setup-deno@v2.0.5
4747
with:
4848
deno-version: ${{ inputs.deno-version || 'v2.8.3' }}
49-
# Keeps the pnpm store on the cache volume for the `pnpm install` of the test application
50-
- name: Mount pnpm store
51-
uses: ./.github/actions/mount-pnpm-store
5249
- name: Install pnpm
5350
uses: ./.github/actions/install-pnpm
5451

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
name: 'Restore dependency & build cache'
2-
description: 'Installs dependencies from the Namespace cache volume and restores the build output.'
2+
description: 'Restore the dependency & build cache.'
3+
4+
inputs:
5+
dependency_cache_key:
6+
description: 'The dependency cache key'
7+
required: true
38

49
runs:
510
using: 'composite'
611
steps:
12+
- name: Install pnpm
13+
uses: ./.github/actions/install-pnpm
14+
15+
- name: Check dependency cache
16+
id: dep-cache
17+
uses: actions/cache/restore@v6.1.0
18+
with:
19+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
20+
key: ${{ inputs.dependency_cache_key }}
21+
722
- name: Restore build artifacts
823
uses: actions/download-artifact@v7
924
with:
1025
name: build-output
1126

1227
- name: Install dependencies
13-
uses: ./.github/actions/install-dependencies
28+
if: steps.dep-cache.outputs.cache-hit != 'true'
29+
run: pnpm install --frozen-lockfile
30+
shell: bash

‎.github/workflows/auto-fix-issue.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ concurrency:
2323

2424
jobs:
2525
auto-fix-issue:
26-
runs-on: namespace-profile-sentry-javascript
26+
runs-on: ubuntu-latest
2727
environment: ci-triage
2828
permissions:
2929
# Required to create a new branch and commit the fix

‎.github/workflows/auto-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
release:
16-
runs-on: namespace-profile-sentry-javascript-small
16+
runs-on: ubuntu-24.04
1717
name: 'Prepare a new version'
1818

1919
steps:

0 commit comments

Comments
 (0)