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 3 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
4 changes: 4 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
9 changes: 9 additions & 0 deletions ecosystem-ci.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fetch from 'node-fetch'
Aslemammad marked this conversation as resolved.
Show resolved Hide resolved
import fs from 'fs'
import path from 'path'
import process from 'process'
Expand All @@ -23,6 +24,14 @@ 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}`
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
}
}
const { root, vitePath, workspace } = await setupEnvironment()
const suitesToRun = getSuitesToRun(suites, root)
let viteMajor
Expand Down