Skip to content

Commit

Permalink
Merge branch 'canary' into optimize-module-selector-bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Mar 1, 2024
2 parents 11732c8 + d12693e commit a4d31b7
Show file tree
Hide file tree
Showing 403 changed files with 42,114 additions and 12,562 deletions.
452 changes: 452 additions & 0 deletions .github/actions/next-integration-stat/dist/37.index.js

Large diffs are not rendered by default.

44,962 changes: 36,823 additions & 8,139 deletions .github/actions/next-integration-stat/dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/actions/next-integration-stat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"node-fetch": "^2.6.8",
"@actions/github": "^6.0.0",
"node-fetch": "^3.3.2",
"semver": "^7.3.8",
"strip-ansi": "^7.0.1"
},
Expand Down
29 changes: 24 additions & 5 deletions .github/actions/next-integration-stat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ async function findNextJsVersionFromBuildLogs(
token: string,
job: Job
): Promise<string> {
console.log('Checking logs for the job ', job.name)
console.log(
'findNextJsVersionFromBuildLogs: Checking logs for the job ',
job.name
)

// downloadJobLogsForWorkflowRun returns a redirect to the actual logs
const jobLogRedirectResponse =
Expand All @@ -34,10 +37,18 @@ async function findNextJsVersionFromBuildLogs(
job_id: job.id,
})

console.log(
'findNextJsVersionFromBuildLogs: Trying to get logs from redirect url ',
jobLogRedirectResponse.url
)

// fetch the actual logs
const jobLogsResponse = await nodeFetch(jobLogRedirectResponse.url, {
headers: {
Authorization: `token ${token}`,
Accept: 'application/vnd.github.v3+json',
// [NOTE] we used to attach auth token, but seems this can cause 403
// redirect url is public anyway
//Authorization: `token ${token}`,
},
})

Expand Down Expand Up @@ -71,7 +82,10 @@ async function fetchJobLogsFromWorkflow(
token: string,
job: Job
): Promise<{ logs: string; job: Job }> {
console.log('Checking test results for the job ', job.name)
console.log(
'fetchJobLogsFromWorkflow: Checking test results for the job ',
job.name
)

// downloadJobLogsForWorkflowRun returns a redirect to the actual logs
const jobLogRedirectResponse =
Expand All @@ -81,11 +95,16 @@ async function fetchJobLogsFromWorkflow(
job_id: job.id,
})

console.log(
'fetchJobLogsFromWorkflow: Trying to get logs from redirect url ',
jobLogRedirectResponse.url
)

// fetch the actual logs
const jobLogsResponse = await nodeFetch(jobLogRedirectResponse.url, {
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `token ${token}`,
//Authorization: `token ${token}`,
},
})

Expand Down Expand Up @@ -235,7 +254,7 @@ async function getJobResults(
const buildTimeMatch = (
nextSwcBuildLogs.find((line) => line.includes('Time (abs ≡):')) ?? ''
).match(/ ([+-]?(?=\.\d|\d)(?:\d+)?(?:\.?\d*))(?:[Ee]([+-]?\d+))? s/)
const buildTime = buildTimeMatch.length >= 2 ? buildTimeMatch[1] : undefined
const buildTime = buildTimeMatch?.length >= 2 ? buildTimeMatch[1] : undefined
const nextSwcBuildSize = (
nextSwcBuildLogs.find(
(line) =>
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ jobs:
run: node scripts/normalize-version-bump.js

- name: Build
run: turbo run build-wasm -vvv --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }} --features tracing/release_max_level_info
run: turbo run build-wasm -vvv --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }}

- name: Add target to folder name
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-${{ matrix.target }} || ls packages/next-swc/crates/wasm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,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
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 && 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

Expand Down
Loading

0 comments on commit a4d31b7

Please sign in to comment.