Skip to content
Open
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
66 changes: 51 additions & 15 deletions .github/workflows/build.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been split into two separate jobs, rather than a matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at the commit history, you'll see I've started with that exact approach, and gave up as I wasn't able to make it work. Open to suggestions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks like the runs failed with Error when evaluating 'strategy' for job 'build'. .github/workflows/build.yml (Line: 41, Col: 21): Unexpected value 'pull_request', .github/workflows/build.yml (Line: 42, Col: 15): Unexpected value 'nodejs/nodejs.org', which seems like it was just a syntax error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like I said, open to suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably start with keeping it as the matrix it was before, and switching to the slim runner? Then if that works, look at adding the other changes you made that exclude certain runs etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe that's just a me-thing, but your use of question mark on sentences that are clearly not questions is... frustrating. It reads to me as the equivalent of writing if(console.log('Hello')); instead of console.log('hello');.
We can discuss decoupling (and if someone wants to open an alternative PR, that's great), but the more pressing problems is that it looks like lots of jobs are not compatible with the slim runners.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are questions. I am asking if that change can be done, as I would not like to land this as-is with the jobs being split out of what was a working matrix before, creating duplication.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit concerned about using the lightweight runners here, given we've struggled with long build times, and recently needed to switch to more powerful Vercel runners as well?

Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,57 @@ env:
TURBO_ARGS: --cache-dir=.turbo/cache

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
build-linux:
name: Build on ubuntu-latest # Name must match the repo setting
runs-on: ubuntu-slim

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
with:
pnpm: true
use-version-file: true
# We only want to install required production packages
install-flags: --prod

- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ github.workspace }}/apps/site/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-

- name: Build Next.js
# We want a ISR build on CI to ensure that regular Next.js builds work as expected.
run: node_modules/.bin/turbo build ${{ env.TURBO_ARGS }}
env:
# We want to ensure we have enough RAM allocated to the Node.js process
# this should be a last resort in case by any chances the build memory gets too high
# but in general this should never happen
NODE_OPTIONS: '--max_old_space_size=4096'
# See https://github.com/vercel/next.js/pull/81318
TURBOPACK_STATS: true

- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: webpack-stats
path: apps/site/.next/server/webpack-stats.json

- name: Build Next.js (Static Export)
# We want to generate a static build, as it is a requirement of our website.
run: node_modules/.bin/turbo deploy ${{ env.TURBO_ARGS }}
env:
# We want to ensure we have enough RAM allocated to the Node.js process
# this should be a last resort in case by any chances the build memory gets too high
# but in general this should never happen
NODE_OPTIONS: '--max_old_space_size=4096'
# We want to ensure that static exports for all locales do not occur on `pull_request` events
# TODO: The output of this is too large, and it crashes the GitHub Runner
NEXT_PUBLIC_STATIC_EXPORT_LOCALE: false # ${{ github.event_name == 'push' }}

build-windows:
name: Build on Windows
runs-on: windows-latest

if: github.event_name != 'merge_group' || github.repository == 'nodejs/nodejs.org'

steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
Expand All @@ -49,7 +92,6 @@ jobs:

- name: Use GNU tar instead BSD tar
# This ensures that we use GNU `tar` which is more efficient for extracting caches's
if: matrix.os == 'windows-latest'
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

Expand All @@ -68,13 +110,7 @@ jobs:
# but in general this should never happen
NODE_OPTIONS: '--max_old_space_size=4096'
# See https://github.com/vercel/next.js/pull/81318
TURBOPACK_STATS: ${{ matrix.os == 'ubuntu-latest' }}

- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: matrix.os == 'ubuntu-latest'
with:
name: webpack-stats
path: apps/site/.next/server/webpack-stats.json
TURBOPACK_STATS: false

- name: Build Next.js (Static Export)
# We want to generate a static build, as it is a requirement of our website.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bundle-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
jobs:
compare:
name: Compare Bundle Stats
runs-on: ubuntu-latest
runs-on: ubuntu-slim
if: github.event.workflow_run.event == 'pull_request'

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
)

name: Chromatic
runs-on: ubuntu-latest
runs-on: ubuntu-slim

environment:
name: Storybook
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:

jobs:
create-post:
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
startsWith(github.event.pull_request.head.ref, 'dependabot/') == false &&
github.event.label.name == 'github_actions:pull-request'
name: Get Vercel Preview
runs-on: ubuntu-latest
runs-on: ubuntu-slim
outputs:
deployment_found: ${{ steps.set_outputs.outputs.deployment_found }}
url: ${{ steps.set_outputs.outputs.url }}
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
needs: get-vercel-preview
if: needs.get-vercel-preview.outputs.deployment_found == 'true'
name: Lighthouse Report
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- name: Harden Runner
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ env:
jobs:
lint:
name: Quality checks
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

tests:
name: Tests
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/notify-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
if: >
github.repository == 'nodejs/nodejs.org' &&
github.actor != 'github-merge-queue[bot]'
runs-on: ubuntu-latest
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-24.04-arm
steps:
- uses: nodejs/web-team/actions/notify-on-push@9f3c83af227d721768d9dbb63009a47ed4f4282f
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright-cloudflare-open-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:
jobs:
playwright:
name: Playwright Tests
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ permissions:
jobs:
get-vercel-preview:
name: Get Vercel Preview
runs-on: ubuntu-latest
runs-on: ubuntu-slim
outputs:
deployment_found: ${{ steps.set_outputs.outputs.deployment_found }}
url: ${{ steps.set_outputs.outputs.url }}
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
needs: get-vercel-preview
if: needs.get-vercel-preview.outputs.deployment_found == 'true'
name: Playwright Tests
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:

jobs:
prepare-packages:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
outputs:
# Output the matrix of packages to publish for use in the publish job
matrix: ${{ steps.generate-matrix.outputs.matrix }}
Expand Down Expand Up @@ -96,7 +96,8 @@ jobs:

publish:
needs: prepare-packages
runs-on: ubuntu-latest
# cannot use ubuntu-slim here because rtCamp/action-slack-notify is dockerized
runs-on: ubuntu-24.04-arm
# Skip if no packages need to be published
if: fromJson(needs.prepare-packages.outputs.matrix).package[0] != null
# Use the dynamic matrix from prepare-packages job to create parallel jobs for each package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# this Workflow again
remove_pull_request_label:
name: Remove Pull Request Label
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/request-codeowner-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
request-reviews:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-orama.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:
jobs:
sync-orama-cloud:
name: Sync Orama Cloud
runs-on: ubuntu-latest
runs-on: ubuntu-slim

# This Job should run either on non-`pull_request_target` events,
# or `pull_request_target` event with a `labeled` action with a label named `github_actions:pull-request`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tmp-cloudflare-open-next-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ permissions:
jobs:
deploy:
name: Deploy Open-Next site
runs-on: ubuntu-latest
runs-on: ubuntu-slim

steps:
- name: Harden Runner
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations-pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
(github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' && github.event.pull_request.head.ref != 'chore/crowdin')

name: Comment on Translation PR
runs-on: ubuntu-latest
runs-on: ubuntu-slim

permissions:
# This permission is required by `thollander/actions-comment-pull-request`
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/translations-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

format_crowdin_pull_request:
needs: synchronize-with-crowdin
runs-on: ubuntu-latest
runs-on: ubuntu-slim

permissions:
# This permission is required by `stefanzweifel/git-auto-commit-action`
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/translations-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ concurrency:

jobs:
upload-to-crowdin:
runs-on: ubuntu-latest
# cannot use ubuntu-slim here because crowdin/github-action is dockerized
runs-on: ubuntu-24.04-arm

steps:
- name: Harden Runner
Expand Down
Loading