Skip to content

Commit

Permalink
ci: try overriding the next swc version for deploy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lubieowoce committed Sep 3, 2024
1 parent caca75d commit f22965d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/test_e2e_deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ jobs:
matrix:
group: [1/5, 2/5, 3/5, 4/5, 5/5, 6/6]
with:
afterBuild: NEXT_TEST_MODE=deploy NEXT_TEST_VERSION="https://vercel-packages.vercel.app/next/commits/${{ github.sha }}/next" NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json" node run-tests.js --timings -g ${{ matrix.group }} -c 2 --type e2e
afterBuild: >-
NEXT_TEST_MODE=deploy
NEXT_TEST_VERSION="https://vercel-packages.vercel.app/next/commits/${{ github.sha }}/next"
NEXT_TEST_SWC_PACKAGE_NAME="@next/swc-linux-x64-gnu"
NEXT_TEST_SWC_PACKAGE_VERSION="https://vercel-packages.vercel.app/next/commits/${{ github.sha }}/@next/swc-linux-x64-gnu"
NEXT_EXTERNAL_TESTS_FILTERS="test/deploy-tests-manifest.json"
node run-tests.js --timings -g ${{ matrix.group }} -c 2 --type e2e
skipNativeBuild: 'yes'
stepName: 'test-deploy-${{ matrix.group }}'
timeout_minutes: 180
Expand Down
9 changes: 9 additions & 0 deletions test/lib/next-modes/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ export class NextInstance {

if (skipInstall || skipIsolatedNext) {
const pkgScripts = (this.packageJson['scripts'] as {}) || {}
const nextSwcOverride =
process.env.NEXT_TEST_SWC_PACKAGE_NAME &&
process.env.NEXT_TEST_SWC_PACKAGE_VERSION
? {
[process.env.NEXT_TEST_SWC_PACKAGE_NAME]:
process.env.NEXT_TEST_SWC_PACKAGE_VERSION,
}
: undefined
await fs.mkdir(this.testDir, { recursive: true })
await fs.writeFile(
path.join(this.testDir, 'package.json'),
Expand All @@ -183,6 +191,7 @@ export class NextInstance {
next:
process.env.NEXT_TEST_VERSION ||
require('next/package.json').version,
...nextSwcOverride,
},
...(this.resolutions ? { resolutions: this.resolutions } : {}),
scripts: {
Expand Down

0 comments on commit f22965d

Please sign in to comment.