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
31 changes: 16 additions & 15 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
name: 'Install pnpm dependencies'
description: 'Installs pnpm dependencies and caches them.'

outputs:
cache_key:
description: 'The dependency cache key'
value: ${{ steps.compute_lockfile_hash.outputs.hash }}
description: 'Installs pnpm dependencies into node_modules folders on the Namespace cache volume.'

runs:
using: 'composite'
steps:
- name: Install pnpm
uses: ./.github/actions/install-pnpm

- name: Compute dependency cache key
id: compute_lockfile_hash
run: node ./scripts/dependency-hash-key.js >> "$GITHUB_OUTPUT"
- name: List dependency paths
id: paths
run: |
{
echo 'paths<<EOF'
node -e 'const { workspaces } = require("./package.json"); for (const dir of [".", ...workspaces]) console.log(require("path").resolve(dir, "node_modules"))'
echo '~/.cache/mongodb-binaries'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
shell: bash

- name: Check dependency cache
uses: actions/cache@v6.1.0
id: cache_dependencies
- name: Mount dependency cache
uses: namespacelabs/nscloud-cache-action@1124a6f3ce44e5cf84cc22111530961f4d2a15f9 # v1.7.0
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
cache: pnpm
path: ${{ steps.paths.outputs.paths }}

# The cache volume can hold node_modules of another commit or branch. This is a no-op when they match
# pnpm-lock.yaml.
- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
shell: bash
44 changes: 11 additions & 33 deletions .github/actions/install-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Install Playwright dependencies'
description: 'Installs Playwright dependencies and caches them.'
description: 'Installs Playwright browsers and system dependencies, keeping both on the Namespace cache volume.'
inputs:
browsers:
description: 'What browsers to install.'
Expand All @@ -26,43 +26,21 @@ runs:
shell: bash
working-directory: ${{ inputs.cwd }}

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

# We always install all browsers, if uncached
# `npx` runs outside the repo, so it can't pick up a `playwright` that a parallel `pnpm install` is still linking.
- name: Install Playwright dependencies (uncached)
env:
PLAYWRIGHT_VERSION: ${{ steps.playwright-version.outputs.version }}
run: npx -y "playwright@$PLAYWRIGHT_VERSION" install chromium webkit firefox --with-deps
if: steps.playwright-version.outputs.version != '' && steps.playwright-cache.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ runner.temp }}

- name: Install Playwright system dependencies only (cached)
# Downloads only the browsers and apt packages that are not on the cache volume yet. `npx` runs outside the repo,
# so it can't pick up a `playwright` that a parallel `pnpm install` is still linking.
- name: Install Playwright
if: steps.playwright-version.outputs.version != ''
env:
PLAYWRIGHT_BROWSERS: ${{ inputs.browsers || 'chromium webkit firefox' }}
PLAYWRIGHT_VERSION: ${{ steps.playwright-version.outputs.version }}
run: npx -y "playwright@$PLAYWRIGHT_VERSION" install-deps $PLAYWRIGHT_BROWSERS
if: steps.playwright-version.outputs.version != '' && steps.playwright-cache.outputs.cache-hit == 'true'
run: npx -y "playwright@$PLAYWRIGHT_VERSION" install --with-deps $PLAYWRIGHT_BROWSERS
shell: bash
working-directory: ${{ runner.temp }}

# Only store cache on develop branch
- name: Store cached playwright binaries
uses: actions/cache/save@v6.1.0
if:
steps.playwright-version.outputs.version != '' && github.event_name == 'push' && github.ref ==
'refs/heads/develop'
with:
path: |
~/.cache/ms-playwright
# Bump the iteration when bumping runner images to use a new cache
key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }}
21 changes: 2 additions & 19 deletions .github/actions/restore-cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
name: 'Restore dependency & build cache'
Comment thread
nicohrubec marked this conversation as resolved.
description: 'Restore the dependency & build cache.'

inputs:
dependency_cache_key:
description: 'The dependency cache key'
required: true
description: 'Installs dependencies from the Namespace cache volume and restores the build output.'

runs:
using: 'composite'
steps:
- name: Install pnpm
uses: ./.github/actions/install-pnpm

- name: Check dependency cache
id: dep-cache
uses: actions/cache/restore@v6.1.0
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ inputs.dependency_cache_key }}

- name: Restore build artifacts
uses: actions/download-artifact@v7
with:
name: build-output

- name: Install dependencies
if: steps.dep-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
shell: bash
uses: ./.github/actions/install-dependencies
2 changes: 1 addition & 1 deletion .github/workflows/auto-fix-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:

jobs:
auto-fix-issue:
runs-on: ubuntu-latest
runs-on: namespace-profile-sentry-javascript
environment: ci-triage
permissions:
# Required to create a new branch and commit the fix
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
release:
runs-on: ubuntu-24.04
runs-on: namespace-profile-sentry-javascript-small
name: 'Prepare a new version'

steps:
Expand Down
Loading
Loading