Skip to content

Commit

Permalink
ci: Add daily test job for react canary (#2601)
Browse files Browse the repository at this point in the history
* ci: Add daily test job for react canary

Signed-off-by: suyanhanx <suyanhanx@gmail.com>

* chore: fix failed test and make pnpm version is sync with `packageManger`

* chore: cleanup

---------

Signed-off-by: suyanhanx <suyanhanx@gmail.com>
Co-authored-by: Yixuan Xu <yixuanxu94@outlook.com>
  • Loading branch information
suyanhanx and promer94 authored May 4, 2023
1 parent 3c91aff commit 5c705e0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test React Canary

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
uses: ./.github/workflows/install

- name: Install Canary
run: corepack pnpm upgrade react@canary react-dom@canary use-sync-external-store@canary

- name: Lint and test
run: |
pnpm run-all-checks
pnpm clean
pnpm build
pnpm test:build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@
"dependencies": {
"use-sync-external-store": "^1.2.0"
}
}
}
17 changes: 12 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion test/use-swr-suspense.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ describe('useSWR - suspense', () => {
<Section />
</Suspense>
)

// FIXME: without this line, the test will fail with react@canary
await sleep(5)
await screen.findByText(updatedKey)
// fixes https://github.com/vercel/swr/issues/57
// initialKey' -> undefined -> updatedKey
Expand Down

0 comments on commit 5c705e0

Please sign in to comment.