Skip to content

Commit 50cff2a

Browse files
authored
ci: add test-publish (#477)
<!-- Thank you for submitting a pull request! We appreciate the time and effort you have invested in making these changes. Please ensure that you provide enough information to allow others to review your pull request. Upon submission, your pull request will be automatically assigned with reviewers. If you want to learn more about contributing to this project, please visit: https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md. --> ## Summary <!-- Can you explain the reasoning behind implementing this change? What problem or issue does this pull request resolve? --> A new test `test-publish` has been added. This test setup a mocked NPM registry using `@pnpm/registry-mock` ([verdaccio](https://verdaccio.org/) underhood) and publish all packages to that registry. Then a Rspeedy App will be created and tested using the newly published packages. This is used to avoid future regression like: #475, #478 and #479. <!-- It would be helpful if you could provide any relevant context, such as GitHub issues or related discussions. --> ## Checklist <!--- Check and mark with an "x" --> - [x] Tests updated (or not required). - [ ] Documentation updated (or not required).
1 parent 1716f74 commit 50cff2a

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ jobs:
132132
--no-cache
133133
--logHeapUsage
134134
--silent
135+
test-publish:
136+
needs: build
137+
uses: ./.github/workflows/workflow-test.yml
138+
permissions:
139+
contents: read
140+
pull-requests: read
141+
statuses: read
142+
with:
143+
runs-on: lynx-ubuntu-24.04-medium
144+
run: |
145+
pnpm dlx @pnpm/registry-mock prepare
146+
pnpm dlx @pnpm/registry-mock &
147+
printf '\n//localhost:4873/:_authToken="this-is-a-fake-token"\n' >> ~/.npmrc
148+
pnpm changeset version --snapshot regression
149+
node packages/tools/canary-release/snapshot.js
150+
pnpm --recursive publish --no-git-checks --access public --registry=http://localhost:4873
151+
cd `mktemp -d`
152+
npx --registry http://localhost:4873 create-rspeedy-canary@latest --template react --dir create-rspeedy-regression
153+
cd create-rspeedy-regression
154+
pnpm install --registry=http://localhost:4873
155+
pnpm run build
135156
test-tools:
136157
needs: build
137158
uses: ./.github/workflows/workflow-test.yml
@@ -176,6 +197,7 @@ jobs:
176197
pnpm --filter @lynx-js/web-tests run test --reporter='github,dot,junit,html'
177198
pnpm --filter @lynx-js/web-tests run coverage:ci
178199
test-rust:
200+
needs: build
179201
uses: ./.github/workflows/rust.yml
180202
secrets:
181203
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -188,6 +210,7 @@ jobs:
188210
- code-style-check
189211
- playwright-linux
190212
- test-plugins
213+
- test-publish
191214
- test-react
192215
- test-rust
193216
- test-rspeedy

.github/workflows/workflow-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
NODE_OPTIONS: --max-old-space-size=8192
6969
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
7070
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7172
run: ${{ inputs.run }}
7273
- name: Upload coverage reports to Codecov
7374
uses: codecov/codecov-action@v5

cspell.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"manypkg", // https://github.com/Thinkmill/manypkg
7777
"messageformat", // https://formatjs.github.io/docs/intl-messageformat
7878
"memfs",
79+
"mktemp",
7980
"napi",
8081
"nocheck", // @ts-nocheck :)
8182
"pathinfo", // webpack config output.pathinfo

0 commit comments

Comments
 (0)