Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pkg.pr.new #313

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
required: true
type: string
default: "vitejs/vite"
commit:
description: "vite commit sha to use"
type: string
suite:
description: "testsuite to run. runs all testsuits when `-`."
required: false
Expand Down Expand Up @@ -115,6 +118,7 @@ jobs:
pnpm tsx ecosystem-ci.ts
--branch ${{ inputs.branchName }}
--repo ${{ inputs.repo }}
--commit ${{ inputs.commit }}
Aslemammad marked this conversation as resolved.
Show resolved Hide resolved
${{ inputs.suite }}
- id: get-ref
if: always()
Expand Down Expand Up @@ -181,6 +185,7 @@ jobs:
pnpm tsx ecosystem-ci.ts
--branch ${{ inputs.branchName }}
--repo ${{ inputs.repo }}
--commit ${{ inputs.commit }}
${{ matrix.suite }}
- id: get-ref
if: always()
Expand Down
11 changes: 11 additions & 0 deletions ecosystem-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ cli
.option('--commit <commit>', 'vite commit sha to use')
.option('--release <version>', 'vite release to use from npm registry')
.action(async (suites, options: CommandOptions) => {
if (options.commit) {
const url = `https://pkg.pr.new/${options.repo}/vite@${options.commit}`
//eslint-disable-next-line n/no-unsupported-features/node-builtins
const { status } = await fetch(url)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be able to use head request here to avoid download

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (status === 200) {
options.release = url
Aslemammad marked this conversation as resolved.
Show resolved Hide resolved
delete options.commit

console.log(`continuous release available on ${url}`)
}
}
const { root, vitePath, workspace } = await setupEnvironment()
const suitesToRun = getSuitesToRun(suites, root)
let viteMajor
Expand Down