Commit graph

38 commits

Author SHA1 Message Date
Victor Berchet
67ffcd0963
ci: enable Node compile cache (#11451) 2025-11-27 18:11:50 +01:00
Victor Berchet
52bc66512d
ci: drop pnpm-filter in install-dependencies (#11420) 2025-11-26 07:35:33 +00:00
Pete Bacon Darwin
4d61faed1c
modernize kv-asset-handler so that we can test is in Node 22+ (#11348)
* modernize kv-asset-handler so that we can test is in Node 22+

* suggestion from Vic

* fix exports on the kv-asset-handler package.json

* move kv-asset-handler tests back into main test run

* only test on Node 22

Node 20 has been in Maintenance for over a year and will become end of life in April 2026.
Node 22 entered Maintenance in October and is arguably the most stable and supported version right now.

* also test packages on Node 20 and 24

* really don't run interactive-dev tests on Windows

* remove redundant service-worker-mock

* wait for the old port to be closed

* Add resilience to reading and writing the dev registry files

* give prisma tests a bit longer to run
2025-11-22 11:40:45 +00:00
Victor Berchet
e1b004c277
ci: Only install uv for c3 tests (#11378) 2025-11-22 11:16:15 +00:00
Victor Berchet
5c0c611469
refactor: make CI do less unneeded work (#11372)
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
2025-11-21 14:12:45 +01:00
Dominik Picheta
c07036b774
Use pywrangler in Python package.json scripts. (#10990) 2025-10-20 15:00:20 +01:00
Pete Bacon Darwin
0a5bb5a658
refactor: run C3 e2e tests more easily locally and individually (#9533)
* fix: ensure that the `sourcemap-codec` library has been transformed correctly to be imported in workerd during Vitest runs

Prior to this the inline snapshot tests were failing because they use the `magic-string` library, which in turn relies upon the `sourcemap-codec` library.

This resulted in errors that look like:

```
Error running worker: SyntaxError: The requested module '@jridgewell/sourcemap-codec' does not provide an export named 'encode'
```

* refactor: run C3 e2e tests more easily locally and individually

* fixup! refactor: run C3 e2e tests more easily locally and individually

* move to-exist helper back to setup file

* rename the filtering env vars

* fixup! refactor: run C3 e2e tests more easily locally and individually

* fix c3 e2e ci groups

* remove unnecessary step

* skip gatsby on yarn

* Run windows tests in a normal directory

* skip Workers tests on Windows

* match the previous test descriptions
2025-07-01 08:39:31 +00:00
Somhairle MacLeòid
3fe85d4882
Bump to Node.js 20 (#9112)
* Bump to Node.js 20

* fix checks

* err => warning

* 18 -> 20

* Create young-trainers-do.md

* update E2E tests

* fix lockfile
2025-05-02 14:14:39 +01:00
emily-shen
dfbf03f87e
add react-router c3 template (#8553)
* add react-router c3 template

* fix duplicate $schema in wrangler.jsonc

* add test

* changeset

* fix test

* fix schema adding

* actually fix :(

* fix type error

* pr review

* hide remix

* update c3 tests node version

* set vite localhost in tests :(

* fix double git question

* Update packages/create-cloudflare/templates/react-router/c3.ts

Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>

* bump node again to appease angular

* hopefully bust turbo cache after node bump

* trailing comma >:(

* add node version in more places

* set pnpm store location

* Revert "set pnpm store location"

This reverts commit c608b24fc3.

* nuxt no install

---------

Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
2025-03-24 12:57:52 +00:00
emily-shen
7c05b1b35c
bump node in ci (#8060) 2025-02-07 18:07:09 +00:00
Pete Bacon Darwin
ca41ebf0e5
CI: compute the name for artifacts correctly (#7963)
In the `run-c3-e2e` GH Action we compute various things from the inputs. In particular using `experimental` and `quarantine`.

But it seems that these are converted to strings rather than booleans, so we cannot simple check the truthy state of `inputs.quarantine`, for example since this might have the value `"false"`, which is truthy.
2025-01-29 12:36:27 +00:00
Edmund Hung
f785f128b6
chore: update workflow default node version (#7649) 2024-12-30 17:09:01 +00:00
Pete Bacon Darwin
6c714a4ba6
chore: use upload-artifact@v4 for C3 e2e tests (#7111)
* chore: include C3 e2e logs in turbo outputs

* ci: update C3 e2e tests to use `actions/upload-artifacts@4`

* ci: run c3 e2e tests on all PRs

These no longer require API tokens to pass and when cached are very fast
2024-11-12 12:10:24 +01:00
Somhairle MacLeòid
71d0c6612e
Restore turbo loose mode (#7102) 2024-10-28 20:01:15 +00:00
Edmund Hung
f9e913402f
chore: stop uploading c3 diff (#7043) 2024-10-22 12:33:28 +01:00
Andy Jessop
f16f961eb6
chore: upgrade to pnpm 9.12.0 (#6886) 2024-10-03 20:06:09 +02:00
Pete Bacon Darwin
0195621241
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
2024-09-26 15:00:20 +01:00
Somhairle MacLeòid
4653bbaf90
Bump pnpm from 9.1.3 to 9.10.0 (#6707) 2024-09-13 19:42:39 +01:00
Pete Bacon Darwin
200332c791
chore: downgrade the action to v3 for reading artifacts (#6351) 2024-07-29 10:19:27 +01:00
Pete Bacon Darwin
ff6b38be2e
chore: downgrade artifact-actions for C3 jobs (#6349) 2024-07-26 19:57:22 +01:00
Pete Bacon Darwin
d31c3f4d54
chore: bump upload-artifact action for C3 (#6343) 2024-07-26 10:37:05 +01:00
Sunil Pai
977f79ec5c
setup the npm registry url with setup-node config (#6056)
This should remove the `WARN  Issue while reading "/Users/***/dev/cloudflare/workers-sdk/.npmrc". Failed to replace env in config: ${NPM_PUBLISH_TOKEN}
` warning we always
2024-06-15 14:25:17 +01:00
Pete Bacon Darwin
f8090d23c5
Update Github Action dependency versions (#6040)
* ci: update actions/checkout to v4

The new version stops using Node.js 16 which is causing warnings in our actions.

* ci: update actions/github-script to v7

This uses Node.js 20 rather than 16

* ci: update pnpm/action-setup to v7

This version uses Node.js 20 rather than 16

* ci: update actions/setup-node to v4

This version uses Node.js v20 rather than v16
2024-06-14 16:59:11 +01:00
Andy Jessop
e19903d720
chore: bump pnpm version to avoid lockfile conflicts (#5985)
Co-authored-by: Andy Jessop <ajessop@cloudflare.com>
2024-06-06 11:56:19 +02:00
Somhairle MacLeòid
f71fd33907
Update turbo.json (#5943)
fix(create-cloudflare): fix turbo caching for C3 e2e tests

It seems that currently turbo caching doesn't work properly for
C3 e2e tests, due to some incomplete config setup.

This PR fine tunes the config in `turbo.json` so that caching
works properly again.

---------

Co-authored-by: Carmen Popoviciu <cpopoviciu@cloudflare.com>
2024-05-31 17:29:23 +02:00
Dario Piotrowicz
e51a43c724
[C3] fix: commit changes when framework cli initialized the git repository (#5925)
* [C3] fix: commit changes when framework cli initialized the git repository

* add SAVE_DIFFS to .env.example

* re-introduce test:e2e:x scripts (as they are convenient aliases for local development)

* quarantine Analog

* rename task

* Run builds before all C3 e2e tests

---------

Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>
2024-05-30 13:15:50 +01:00
James Culveyhouse
d0754780c6
[C3] Framework migration diffs (#5716)
* C3: Generate migration diffs for framework templates

* Fix an issue where --no-git flag wasn't being respected

* Generate and store framework diffs during e2e

* Remove trash

* Fix issues with create-* tools that commit by default

* Skip diffs in quarantine and add placeholder directory for c3-framework-diffs

* Invert check for storing diffs

* Fix check for quarantine skip

* Try making if conditions work in github actions

* Fix conditional

* Git checkout PR branch on c3 e2e job

* test

* Refactor to a separate action for creating docs PR thats only run on release branch

* Responding to PR feedback

* Addressing more PR feedback

* Use newly created access token

* Quarantine hono on windows

* Addressing PR feedback
2024-05-20 16:43:11 -05:00
Somhairle MacLeòid
5dd95736e8
Run prerelease using global pnpm (#5856)
* Run prerelease using global pnpm

* Remove pnpm & yarn version import

* turbo-ify

* pnpm windows

* fixups

* split in JS

* fixups

* Actually run the tests 😅

* composite matrix
2024-05-16 18:25:23 +01:00
Pete Bacon Darwin
9c469f69ad
Update pnpm etc (#5809)
* chore: update repo to use pnpm 9.1.1

* chore: update GH Actions to use pnpm 9.1.1

* chore: use install-dependencies custom action across all GH workflows

Also moves the setup of the TURBO cache into that action.
2024-05-15 17:57:16 +01:00
MrBBot
f860aba0ad
ci: easy pre-releases for new packages (#4757)
* ci: easy pre-releases for new packages

* fixup! ci: easy pre-releases for new packages

Expose ACTIONS_RUNTIME_TOKEN and ACTIONS_RESULTS_URL variables

* fixup! ci: easy pre-releases for new packages

Switch to `workers-sdk` object in `package.json`

* fixup! ci: easy pre-releases for new packages

Remove extraneous `|` in pre-release comment

* fixup! ci: easy pre-releases for new packages

Simplify validation/extraction of `githubPullRequestNumber`

* fixup! ci: easy pre-releases for new packages

Use `forEach` instead of `for of`

* fixup! ci: easy pre-releases for new packages

Explain why we need custom action for extracting action variables

* fixup! fixup! ci: easy pre-releases for new packages
2024-01-19 14:46:08 +00:00
Pete Bacon Darwin
652cc4222e
fix(c3): ensure shell scripts work on Windows (#4445)
* fix: ensure C3 shell scripts work on Windows

Our use of `shell-quote` was causing problems on Windows where it was
escaping character (such as `@`) by placing a backslash in front.
This made Windows think that such path arguments, were at the root.

For example, `npm install -D @cloudflare/workers-types` was being converted to
`npm install -D \@cloudflare/workers-types`, which resulted in errors like:

```
npm ERR! enoent ENOENT: no such file or directory, open 'D:\@cloudflare\workers-types\package.json'
```

Now we just rely directly on the Node.js `spawn` API to avoid any shell quoting
concerns. This has resulted in a slightly less streamlined experience for people
writing C3 plugins, but has the benefit that the developer doesn't have to worry
about quoting spawn arguments.

Closes https://github.com/cloudflare/workers-sdk/issues/4282

* C3 e2e - test on CI with Windows + pnpm

* C3 e2e - clean up test projects according to their type

Previously we only deleted Pages projects - in fact we were trying to delete
the Hono (non-Pages) Worker as a Pages project.

Now we delete the project based on its type.

* C3 - framework template fixes for Windows

- do not use bash-style environment variable setting in Docusaurus scripts
- do not run TTY interactive e2e tests on Windows

* C3 e2e - make cleaning up e2e test files more resilient

* C3 - update Nuxt template to avoid requiring Windows incompatible shell environment variable

* C3 e2e - remove noise from expected test errors

* C3 e2e - Only cleanup workers and projects that are over 1 hour old

These e2e test workers and projects should be cleaned up as part of the normal test completion.
But if the test crashes they may be left orphaned.
This change ensures that we do not clean up projects to early while they are still being used.

* C3 e2e - only clean up test projects once per day at 3am

* C3 e2e - fix commit message tests on Windows

* C3 e2e - recreate test folders for each e2e retry

Previously we were reusing folders after clearing them when retrying a
failed test. But this could lead to problems, especially on Windows where
clearing out the folder did not always work.

* C3 e2e - bump test timeout longer

* C3 e2e - do not run C3 e2e tests on unsupported OSes

* C3 e2e - store e2e logs separately by OS

* C3 e2e - Retry some of the checks a few times to reduce flakiness

* C3 e2e - Record vitest results as a json artifact for downloading

* C3 e2e - disable global caches for package managers

This commit uses environment variables to tell package managers to put
cached files in a local directory rather than a global shared one, which
can cause problems with race conditions when running multiple installs
at the same time.

* C3 e2e - don't cancel other matrix jobs if one fails

It is a false optimization to cancel jobs that are likely to pass when
another job flakes out.

* ci: retry the external-durable-objects-app fixture if it flakes

* C3 e2e - drop docusaurus and react tests

These jobs tend to flake out and are not providing much of a useful signal.

* ci: skip fixture tests that exercise the "dev registry"

Reenable when https://github.com/cloudflare/workers-sdk/pull/4241 lands and improves reliability of this test.

* C3 - ensure shell commands in logging are reasonably quoted

C3 often outputs log messages to the user of commands that are being
executed. Users tend to cut and paste these into their terminal to run
themselves. This makes sure that these are likely to just work went
pasted into their shell.

* fixup! C3 - ensure shell commands in logging are reasonably quoted

* fixup! C3 - ensure shell commands in logging are reasonably quoted
2023-11-24 17:10:41 +00:00
James Culveyhouse
af92f9b7e6
C3: E2E logging refactor (#4164)
* C3: Dont show animated spinners in non-interactive terminals

* C3: Write e2e output to log files instead of stdout

* C3: Upload e2e logs as artifacts

* Don't cleanup projects when importing helper

* Adding a .gitkeep to .e2e-logs

* Make per-pm folders

* Upload artifacts when e2e step fails

* Remove hack for testing failure

* Add shell to last step in e2e action

* Suppress console logs in case of error
2023-10-18 12:48:13 -05:00
Somhairle MacLeòid
a78aa08255
Pin pnpm in actions to 8.8.0 (#4156)
* Pin pnpm

* Remove redundant actions
2023-10-12 14:01:24 +01:00
James Culveyhouse
44c66ab1d6
C3: Better e2e quarantine dx (#4096)
* C3: Catch errors in quarantined e2e tests

* Address PR feedback

* fix lint issue

* Split up C3 workflow files and run quarantine e2es on pushed to main

* Pass accountId and token as inputs to e2e action

* Specify shell in github action

* Fix cleanup job trigger

* Allow quarantine tests to fail again
2023-10-10 12:05:25 -05:00
James Culveyhouse
55298d9f3f
C3: Add bun support (#4065)
* Adding bun to pm detection

* Adding bun to pm e2e matrix

* Install bun in CI setup action

* Passing git flag through to nuxi

* Change astro template to basics
2023-09-29 11:12:59 -05:00
Somhairle MacLeòid
702409a564
Workers Playground Shell (#3876) 2023-09-15 01:35:53 +01:00
Somhairle MacLeòid
0938e257b2
Migrate to pnpm (#3889)
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
Co-authored-by: James <jculveyhouse@cloudflare.com>
2023-09-06 16:08:36 +01:00
James Culveyhouse
d885fbea22
C3: Improve e2e testing reliability (#3686)
* C3: Add e2e coverage for pnpm and yarn

* Skipping some tests for debug purposes

* Fixing env variable passing to e2e process

* Change how we force package managers in e2e

* Create a job to cleanup e2e pages projects before running

* Add required env variables to cleanup job

* Consolidate temp directory creation logic

* debug cli tmp project creation

* Skip react and next for debug

* Re-enable all tests

* Running tests serially for debug

* Fix bug in cleanup

* Debug: limit to npm

* Update test account in c3 tests

* Lower the concurrency to help with rate limiting

* Fixing pnpm issues for react and next

* Configure dummy git user and limit runs to npm

* Add more logging

* Parse deployment url from c3 run output. Fix hono expectations
2023-08-15 14:33:41 -04:00