Skip to content

Commit

Permalink
feat: initial changes for qwik-ecosystem-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-stepanenko committed Nov 4, 2024
1 parent befa3af commit a0db30d
Show file tree
Hide file tree
Showing 40 changed files with 88 additions and 721 deletions.
50 changes: 8 additions & 42 deletions .github/workflows/ecosystem-ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# integration tests for vite ecosystem projects - scheduled or manual run for all suites
name: vite-ecosystem-ci
# integration tests for Qwik ecosystem projects - scheduled or manual run for all suites
name: qwik-ecosystem-ci

env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
# configure corepack to be strict but not download newer versions or change anything
COREPACK_DEFAULT_TO_LATEST: 0
COREPACK_ENABLE_AUTO_PIN: 0
COREPACK_ENABLE_STRICT: 1

on:
schedule:
Expand All @@ -26,15 +22,15 @@ on:
- release
default: "branch"
ref:
description: "vite ref to use"
description: "qwik ref to use"
required: true
type: string
default: "main"
repo:
description: "vite repository to use"
description: "qwik repository to use"
required: true
type: string
default: "vitejs/vite"
default: "QwikDev/qwik"
repository_dispatch:
types: [ecosystem-ci]
jobs:
Expand All @@ -44,37 +40,7 @@ jobs:
strategy:
matrix:
suite:
- analogjs
- astro
- histoire
# - hydrogen # disabled until they complete they migration back to Vite
# - iles # disabled until its CI is fixed
- ladle
- laravel
- marko
- nuxt
# - nx # disabled temporarily
- previewjs
- quasar
- qwik
- rakkas
- redwoodjs
- remix
- storybook
- sveltekit
- unocss
- vike
- vite-environment-examples
- vite-plugin-pwa
- vite-plugin-react
# - vite-plugin-react-pages # disabled until its install setup is fixed
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- vuepress
- qwik-ui-headless
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -93,7 +59,7 @@ jobs:
- run: >-
pnpm tsx ecosystem-ci.ts
--${{ inputs.refType || github.event.client_payload.refType || 'branch' }} ${{ inputs.ref || github.event.client_payload.ref || 'main' }}
--repo ${{ inputs.repo || github.event.client_payload.repo || 'vitejs/vite' }}
--repo ${{ inputs.repo || github.event.client_payload.repo || 'QwikDev/qwik' }}
${{ matrix.suite }}
id: ecosystem-ci-run
- if: always()
Expand All @@ -102,7 +68,7 @@ jobs:
WORKFLOW_NAME: ci
REF_TYPE: ${{ inputs.refType || github.event.client_payload.refType || 'branch' }}
REF: ${{ inputs.ref || github.event.client_payload.ref || 'main' }}
REPO: ${{ inputs.repo || github.event.client_payload.repo || 'vitejs/vite' }}
REPO: ${{ inputs.repo || github.event.client_payload.repo || 'QwikDev/qwik' }}
SUITE: ${{ matrix.suite }}
STATUS: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
Expand Down
14 changes: 0 additions & 14 deletions builds/vite-plugin-react.ts

This file was deleted.

22 changes: 0 additions & 22 deletions builds/vite-plugin-svelte.ts

This file was deleted.

15 changes: 0 additions & 15 deletions builds/vite-plugin-vue.ts

This file was deleted.

90 changes: 46 additions & 44 deletions ecosystem-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,40 @@ import { cac } from 'cac'

import {
setupEnvironment,
setupViteRepo,
buildVite,
bisectVite,
parseViteMajor,
setupQwikRepo,
buildQwik,
bisectQwik,
parseQwikMajor,
parseMajorVersion,
} from './utils.ts'
import type { CommandOptions, RunOptions } from './types.d.ts'

const QWIK_REPO = 'QwikDev/qwik'

const cli = cac()
cli
.command('[...suites]', 'build vite and run selected suites')
.command('[...suites]', 'build qwik and run selected suites')
.option('--verify', 'verify checkouts by running tests', { default: false })
.option('--repo <repo>', 'vite repository to use', { default: 'vitejs/vite' })
.option('--branch <branch>', 'vite branch to use', { default: 'main' })
.option('--tag <tag>', 'vite tag to use')
.option('--commit <commit>', 'vite commit sha to use')
.option('--release <version>', 'vite release to use from npm registry')
.option('--repo <repo>', 'qwik repository to use', { default: QWIK_REPO })
.option('--branch <branch>', 'qwik branch to use', { default: 'main' })
.option('--tag <tag>', 'qwik tag to use')
.option('--commit <commit>', 'qwik commit sha to use')
.option('--release <version>', 'qwik release to use from npm registry')
.action(async (suites, options: CommandOptions) => {
const { root, vitePath, workspace } = await setupEnvironment()
const { root, qwikPath, workspace } = await setupEnvironment()
const suitesToRun = getSuitesToRun(suites, root)
let viteMajor
let qwikMajor
if (!options.release) {
await setupViteRepo(options)
await buildVite({ verify: options.verify })
viteMajor = parseViteMajor(vitePath)
await setupQwikRepo(options)
await buildQwik({ verify: options.verify })
qwikMajor = parseQwikMajor(qwikPath)
} else {
viteMajor = parseMajorVersion(options.release)
qwikMajor = parseMajorVersion(options.release)
}
const runOptions: RunOptions = {
root,
vitePath,
viteMajor,
qwikPath,
qwikMajor,
workspace,
release: options.release,
verify: options.verify,
Expand All @@ -48,37 +50,37 @@ cli
})

cli
.command('build-vite', 'build vite only')
.option('--verify', 'verify vite checkout by running tests', {
.command('build-qwik', 'build qwik only')
.option('--verify', 'verify qwik checkout by running tests', {
default: false,
})
.option('--repo <repo>', 'vite repository to use', { default: 'vitejs/vite' })
.option('--branch <branch>', 'vite branch to use', { default: 'main' })
.option('--tag <tag>', 'vite tag to use')
.option('--commit <commit>', 'vite commit sha to use')
.option('--repo <repo>', 'qwik repository to use', { default: QWIK_REPO })
.option('--branch <branch>', 'qwik branch to use', { default: 'main' })
.option('--tag <tag>', 'qwik tag to use')
.option('--commit <commit>', 'qwik commit sha to use')
.action(async (options: CommandOptions) => {
await setupEnvironment()
await setupViteRepo(options)
await buildVite({ verify: options.verify })
await setupQwikRepo(options)
await buildQwik({ verify: options.verify })
})

cli
.command('run-suites [...suites]', 'run single suite with pre-built vite')
.command('run-suites [...suites]', 'run single suite with pre-built qwik')
.option(
'--verify',
'verify checkout by running tests before using local vite',
'verify checkout by running tests before using local qwik',
{ default: false },
)
.option('--repo <repo>', 'vite repository to use', { default: 'vitejs/vite' })
.option('--release <version>', 'vite release to use from npm registry')
.option('--repo <repo>', 'qwik repository to use', { default: QWIK_REPO })
.option('--release <version>', 'qwik release to use from npm registry')
.action(async (suites, options: CommandOptions) => {
const { root, vitePath, workspace } = await setupEnvironment()
const { root, qwikPath, workspace } = await setupEnvironment()
const suitesToRun = getSuitesToRun(suites, root)
const runOptions: RunOptions = {
...options,
root,
vitePath,
viteMajor: parseViteMajor(vitePath),
qwikPath,
qwikMajor: parseQwikMajor(qwikPath),
workspace,
}
for (const suite of suitesToRun) {
Expand All @@ -89,35 +91,35 @@ cli
cli
.command(
'bisect [...suites]',
'use git bisect to find a commit in vite that broke suites',
'use git bisect to find a commit in qwik that broke suites',
)
.option('--good <ref>', 'last known good ref, e.g. a previous tag. REQUIRED!')
.option('--verify', 'verify checkouts by running tests', { default: false })
.option('--repo <repo>', 'vite repository to use', { default: 'vitejs/vite' })
.option('--branch <branch>', 'vite branch to use', { default: 'main' })
.option('--tag <tag>', 'vite tag to use')
.option('--commit <commit>', 'vite commit sha to use')
.option('--repo <repo>', 'qwik repository to use', { default: QWIK_REPO })
.option('--branch <branch>', 'qwik branch to use', { default: 'main' })
.option('--tag <tag>', 'qwik tag to use')
.option('--commit <commit>', 'qwik commit sha to use')
.action(async (suites, options: CommandOptions & { good: string }) => {
if (!options.good) {
console.log(
'you have to specify a known good version with `--good <commit|tag>`',
)
process.exit(1)
}
const { root, vitePath, workspace } = await setupEnvironment()
const { root, qwikPath, workspace } = await setupEnvironment()
const suitesToRun = getSuitesToRun(suites, root)
let isFirstRun = true
const { verify } = options
const runSuite = async () => {
try {
await buildVite({ verify: isFirstRun && verify })
await buildQwik({ verify: isFirstRun && verify })
for (const suite of suitesToRun) {
await run(suite, {
verify: !!(isFirstRun && verify),
skipGit: !isFirstRun,
root,
vitePath,
viteMajor: parseViteMajor(vitePath),
qwikPath,
qwikMajor: parseQwikMajor(qwikPath),
workspace,
})
}
Expand All @@ -127,10 +129,10 @@ cli
return e
}
}
await setupViteRepo({ ...options, shallow: false })
await setupQwikRepo({ ...options, shallow: false })
const initialError = await runSuite()
if (initialError) {
await bisectVite(options.good, runSuite)
await bisectQwik(options.good, runSuite)
} else {
console.log(`no errors for starting commit, cannot bisect`)
}
Expand Down
30 changes: 0 additions & 30 deletions tests/_selftest.ts

This file was deleted.

12 changes: 0 additions & 12 deletions tests/analogjs.ts

This file was deleted.

12 changes: 0 additions & 12 deletions tests/astro.ts

This file was deleted.

12 changes: 0 additions & 12 deletions tests/histoire.ts

This file was deleted.

11 changes: 0 additions & 11 deletions tests/hydrogen.ts

This file was deleted.

Loading

0 comments on commit a0db30d

Please sign in to comment.