Skip to content

Commit

Permalink
ci(workflow): update actions with keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Jan 24, 2024
1 parent 395532d commit 31f262f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 15 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,19 @@ jobs:
if: ${{ steps.check-did-build.outputs.DID_BUILD == 'true' }}
uses: actions/upload-artifact@v4
with:
name: turbopack-bytesize
name: turbopack-bytesize-${{ matrix.settings.target }}
path: turbopack-bin-size/*

- name: Upload swc artifact
uses: actions/upload-artifact@v4
with:
name: next-swc-binaries
name: next-swc-binaries-${{ matrix.settings.target }}
path: packages/next-swc/native/next-swc.*.node

- name: Upload turbo summary artifact
uses: actions/upload-artifact@v4
with:
name: turbo run summary
name: turbo-run-summary-${{ matrix.settings.target }}
path: .turbo/runs

build-wasm:
Expand Down Expand Up @@ -383,7 +383,7 @@ jobs:
- name: Upload turbo summary artifact
uses: actions/upload-artifact@v4
with:
name: turbo run summary
name: turbo-run-summary-wasm
path: .turbo/runs

- name: Upload swc artifact
Expand Down Expand Up @@ -426,7 +426,8 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: next-swc-binaries
pattern: next-swc-binaries-*
merge-multiple: true
path: packages/next-swc/native

- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -480,7 +481,8 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: next-swc-binaries
pattern: next-swc-binaries
merge-multiple: true
path: packages/next-swc/native

- run: cp -r packages/next-swc/native .github/actions/next-stats-action/native
Expand All @@ -501,7 +503,8 @@ jobs:
- name: Collect bytesize metrics
uses: actions/download-artifact@v4
with:
name: turbopack-bytesize
pattern: turbopack-bytesize-*
merge-multiple: true
path: turbopack-bin-size

- name: Upload to Datadog
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
skipInstallBuild: 'yes'
stepName: 'build-native'
secrets: inherit

build-next:
name: build-next
uses: ./.github/workflows/build_reusable.yml
with:
skipNativeBuild: 'yes'
stepName: 'build-next'
secrets: inherit

lint:
Expand All @@ -80,6 +82,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: pnpm lint-no-typescript && pnpm check-examples
stepName: 'lint'
secrets: inherit

validate-docs-links:
Expand All @@ -103,6 +106,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: pnpm types-and-precompiled
stepName: 'types-and-precompiled'
secrets: inherit

test-cargo-unit:
Expand All @@ -117,6 +121,7 @@ jobs:
skipNativeBuild: 'yes'
afterBuild: turbo run test-cargo-unit
mold: 'yes'
stepName: 'test-cargo-unit'
secrets: inherit

rust-check:
Expand All @@ -130,6 +135,7 @@ jobs:
skipInstallBuild: 'yes'
skipNativeBuild: 'yes'
afterBuild: turbo run rust-check
stepName: 'rust-check'
secrets: inherit

test-turbopack-dev:
Expand All @@ -144,6 +150,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.json" TURBOPACK=1 NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_MODE=dev node run-tests.js --test-pattern '^(test\/(development|e2e))/.*\.test\.(js|jsx|ts|tsx)$' --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY}
stepName: 'test-turbopack-dev-${{ matrix.group }}'
secrets: inherit

test-turbopack-integration:
Expand All @@ -159,6 +166,7 @@ jobs:
with:
nodeVersion: 18.17.0
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.json" TURBOPACK=1 node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-turbopack-integration-${{ matrix.group }}'
secrets: inherit

test-next-swc-wasm:
Expand All @@ -169,6 +177,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs --features tracing/release_max_level_info && git checkout . && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/production/pages-dir/production/test/index.test.ts test/e2e/streaming-ssr/index.test.ts
stepName: 'test-next-swc-wasm'
secrets: inherit

test-unit:
Expand All @@ -185,6 +194,7 @@ jobs:
with:
nodeVersion: ${{ matrix.node }}
afterBuild: node run-tests.js -c ${TEST_CONCURRENCY} --type unit
stepName: 'test-unit-${{ matrix.node }}'

secrets: inherit

Expand All @@ -200,6 +210,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development
stepName: 'test-dev-${ matrix.group }}'
secrets: inherit

test-prod:
Expand All @@ -214,6 +225,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production
stepName: 'test-prod-${{ matrix.group }}'
secrets: inherit

test-integration:
Expand Down Expand Up @@ -241,6 +253,7 @@ jobs:
with:
nodeVersion: 18.17.0
afterBuild: node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-integration-${{ matrix.group }}'
secrets: inherit

test-firefox-safari:
Expand All @@ -251,6 +264,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: pnpm playwright install && BROWSER_NAME=firefox node run-tests.js test/production/pages-dir/production/test/index.test.ts && BROWSER_NAME=safari NEXT_TEST_MODE=start node run-tests.js -c 1 test/production/pages-dir/production/test/index.test.ts test/e2e/basepath.test.ts && BROWSER_NAME=safari DEVICE_NAME='iPhone XR' node run-tests.js -c 1 test/production/prerender-prefetch/index.test.ts
stepName: 'test-firefox-safari'
secrets: inherit

# TODO: remove these jobs once PPR is the default
Expand All @@ -266,6 +280,7 @@ jobs:
with:
nodeVersion: 18.17.0
afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" node run-tests.js --timings -c ${TEST_CONCURRENCY} --type integration
stepName: 'test-ppr-integration'
secrets: inherit

test-ppr-dev:
Expand All @@ -280,6 +295,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development
stepName: 'test-ppr-dev-${{ matrix.group }}'
secrets: inherit

test-ppr-prod:
Expand All @@ -294,6 +310,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
with:
afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production
stepName: 'test-ppr-prod-${{ matrix.group }}'
secrets: inherit

report-test-results:
Expand All @@ -319,7 +336,7 @@ jobs:
id: download-test-reports
uses: actions/download-artifact@v4
with:
name: test-reports
pattern: test-reports-*
path: test

- name: Upload test report to datadog
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ on:
required: false
description: 'rustCacheKey to cache shared target assets'
type: string
stepName:
required: true
description: 'name of the step, to be used for the upload artifact unique key '
type: string

env:
NAPI_CLI_VERSION: 2.14.7
Expand Down Expand Up @@ -75,7 +79,17 @@ jobs:
- 'x64'
- 'metal'

outputs:
input_step_key: ${{ steps.var.outputs.input_step_key }}

steps:
- name: Normalize input step names into path key
uses: actions/github-script@v6
id: var
with:
script: |
core.setOutput('input_step_key', '${{ inputs.stepName }}'.toLowerCase().replaceAll(/[/.]/g, '-').trim('-'));
- run: fnm use --install-if-missing ${{ inputs.nodeVersion || env.NODE_LTS_VERSION }}
- run: node -v
- run: corepack enable
Expand Down Expand Up @@ -161,22 +175,22 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: turbo run summary
name: turbo-run-summary-${{ steps.var.outputs.input_step_key }}
path: .turbo/runs
if-no-files-found: ignore

- name: Upload bundle analyzer artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.uploadAnalyzerArtifacts == 'yes' }}
with:
name: webpack bundle analysis stats
name: webpack bundle analysis stats-${{ steps.var.outputs.input_step_key }}
path: packages/next/dist/compiled/next-server/report.*.html

- name: Upload test report artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.afterBuild && always() }}
with:
name: test-reports
name: test-reports-${{ steps.var.outputs.input_step_key }}
path: |
test/test-junit-report
test/turbopack-test-junit-report
Expand All @@ -187,7 +201,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ inputs.afterBuild && always() }}
with:
name: test-playwright-snapshots
name: test-playwright-snapshots-${{ steps.var.outputs.input_step_key }}
path: |
test/traces
if-no-files-found: ignore
7 changes: 4 additions & 3 deletions .github/workflows/nextjs-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Upload test report artifacts
uses: actions/upload-artifact@v4
with:
name: test-reports
name: test-reports-dev-${{ matrix.group }}
path: |
test/turbopack-test-junit-report
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
- name: Upload test report artifacts
uses: actions/upload-artifact@v4
with:
name: test-reports
name: test-reports-integration-${{ matrix.group }}
path: |
test/turbopack-test-junit-report
Expand Down Expand Up @@ -184,8 +184,9 @@ jobs:
id: download-test-reports
uses: actions/download-artifact@v4
with:
name: test-reports
pattern: test-reports-*
path: test/reports
merge-multiple: true

- name: Upload to datadog
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
uses: ./.github/workflows/build_reusable.yml
secrets: inherit
with:
stepName: 'generate-pull-request-stats'
uploadSwcArtifact: 'yes'
uploadAnalyzerArtifacts: 'yes'

Expand Down

0 comments on commit 31f262f

Please sign in to comment.