-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add experimental Next.js, with Workers assets, template (#6830)
* feat: add experimental Next.js, with Workers assets, template This template uses the new `@opennextjs/cloudflare` adaptor. * test: add support for e2e testing of experimental frameworks and workers * ci: Run C3 experimental e2e tests in CI * ci: remove unnecessary build step from C3 e2e job Not only is this unnecessary, the cached does not even get used by the e2e step that follows (probably because the env vars change) so it adds extra time to these jobs. * add logging to c3 e2e test failures * ci: write json test results to the correct directory * test: do not run experimental next.js template e2e tests on Windows
- Loading branch information
1 parent
7ede181
commit 0195621
Showing
17 changed files
with
733 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-cloudflare": patch | ||
--- | ||
|
||
feat: add experimental Next.js, with Workers assets, template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ inputs: | |
quarantine: | ||
description: "Whether to run the tests in quarantine mode" | ||
required: false | ||
experimental: | ||
description: "Whether to run the tests in experimental mode" | ||
required: false | ||
framework: | ||
description: "When specified, will only run tests for this framework" | ||
required: false | ||
|
@@ -39,21 +42,15 @@ runs: | |
git config --global user.email [email protected] | ||
git config --global user.name 'Wrangler automated PR updater' | ||
- name: Build | ||
shell: bash | ||
run: pnpm run build | ||
env: | ||
NODE_ENV: "production" | ||
CI_OS: ${{ runner.os }} | ||
|
||
- name: E2E Tests | ||
- name: E2E Tests ${{inputs.experimental && '(experimental)' || ''}} | ||
id: run-e2e | ||
shell: bash | ||
run: pnpm run test:e2e --filter create-cloudflare | ||
env: | ||
CLOUDFLARE_API_TOKEN: ${{ inputs.apiToken }} | ||
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.accountId }} | ||
E2E_QUARANTINE: ${{ inputs.quarantine }} | ||
E2E_EXPERIMENTAL: ${{ inputs.experimental }} | ||
FRAMEWORK_CLI_TO_TEST: ${{ inputs.framework }} | ||
TEST_PM: ${{ inputs.packageManager }} | ||
TEST_PM_VERSION: ${{ inputs.packageManagerVersion }} | ||
|
@@ -64,15 +61,15 @@ runs: | |
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: e2e-logs-${{matrix.os}} | ||
path: packages/create-cloudflare/.e2e-logs | ||
name: e2e-logs${{inputs.experimental && '-experimental' || ''}}-${{matrix.os}} | ||
path: packages/create-cloudflare/.e2e-logs${{inputs.experimental && '-experimental' || ''}} | ||
|
||
- name: Upload Framework Diffs | ||
if: ${{ steps.run-e2e.outcome == 'success' && inputs.saveDiffs == 'true' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: e2e-framework-diffs | ||
path: packages/create-cloudflare/.e2e-diffs | ||
name: e2e-framework-diffs${{inputs.experimental && '-experimental' || ''}} | ||
path: packages/create-cloudflare/.e2e-diffs${{inputs.experimental && '-experimental' || ''}} | ||
overwrite: true | ||
|
||
- name: Fail if errors detected | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Runs c3 e2e tests on pull requests with c3 changes | ||
|
||
name: C3 E2E Tests (experimental) | ||
on: | ||
pull_request: | ||
paths: | ||
- packages/create-cloudflare/** | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- packages/create-cloudflare/** | ||
|
||
jobs: | ||
e2e: | ||
# Note: please keep this job in sync with the e2e-only-dependabot-bumped-framework one | ||
# in .github/workflows/c3-e2e-dependabot.yml | ||
timeout-minutes: 45 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} | ||
cancel-in-progress: true | ||
name: ${{ format('Run experimental tests for {0}@{1} on {2}', matrix.pm.name, matrix.pm.version, matrix.os) }} | ||
if: github.repository_owner == 'cloudflare' && github.event.pull_request.user.login != 'dependabot[bot]' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
pm: | ||
[ | ||
{ name: npm, version: "0.0.0" }, | ||
{ name: pnpm, version: "9.10.0" }, | ||
{ name: bun, version: "1.0.3" }, | ||
{ name: yarn, version: "1.0.0" }, | ||
] | ||
# include a single windows test with pnpm | ||
include: | ||
- os: windows-latest | ||
pm: { name: pnpm, version: "9.10.0" } | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Dependencies | ||
uses: ./.github/actions/install-dependencies | ||
with: | ||
turbo-api: ${{ secrets.TURBO_API }} | ||
turbo-team: ${{ secrets.TURBO_TEAM }} | ||
turbo-token: ${{ secrets.TURBO_TOKEN }} | ||
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} | ||
|
||
- name: E2E Tests | ||
uses: ./.github/actions/run-c3-e2e | ||
with: | ||
packageManager: ${{ matrix.pm.name }} | ||
packageManagerVersion: ${{ matrix.pm.version }} | ||
quarantine: false | ||
experimental: true | ||
accountId: ${{ secrets.C3_TEST_CLOUDFLARE_ACCOUNT_ID }} | ||
apiToken: ${{ secrets.C3_TEST_CLOUDFLARE_API_TOKEN }} | ||
# We only need to do this once per-framework per-run, so avoid re-running for each package manager and os | ||
saveDiffs: ${{ github.head_ref == 'changeset-release/main' && matrix.pm.name == 'pnpm' && matrix.os == 'ubuntu-latest'}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ dist-functions | |
vscode.d.ts | ||
vscode.*.d.ts | ||
|
||
.e2e-logs | ||
.e2e-logs* | ||
templates/*/build | ||
templates/*/dist | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
node_modules | ||
/dist | ||
create-cloudflare-*.tgz | ||
/.e2e-logs/* | ||
/.e2e-diffs/* | ||
/.e2e-logs*/* | ||
/.e2e-diffs*/* | ||
|
||
.DS_Store | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.