Skip to content

Commit

Permalink
refactor: convert from vite to volar
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Feb 11, 2024
1 parent fb31781 commit cf1cd10
Show file tree
Hide file tree
Showing 42 changed files with 177 additions and 760 deletions.
77 changes: 16 additions & 61 deletions .github/workflows/ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# integration tests for vite ecosystem - run from pr comments
name: vite-ecosystem-ci-from-pr
# integration tests for volar ecosystem - run from pr comments
name: volar-ecosystem-ci-from-pr

env:
# 7 GiB by default on GitHub, setting to 6 GiB
Expand All @@ -14,46 +14,24 @@ on:
required: true
type: string
branchName:
description: "vite branch to use"
description: "volar branch to use"
required: true
type: string
default: "main"
default: "master"
repo:
description: "vite repository to use"
description: "volar repository to use"
required: true
type: string
default: "vitejs/vite"
default: "volarjs/volar.js"
suite:
description: "testsuite to run. runs all testsuits when `-`."
required: false
type: choice
options:
- "-"
- analogjs
- astro
- histoire
# - iles # disabled until its CI is fixed
- ladle
- laravel
- marko
- nuxt
- nx
- previewjs
- qwik
- rakkas
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- unocss
- vike
- vite-plugin-pwa
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- mdx
- vue
jobs:
init:
runs-on: ubuntu-latest
Expand All @@ -64,7 +42,7 @@ jobs:
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.PR_GITHUB_APP_ID }}
installation_retrieval_payload: "${{ github.repository_owner }}/vite"
installation_retrieval_payload: "${{ github.repository_owner }}/volar.js"
private_key: ${{ secrets.PR_GITHUB_APP_PRIVATE_KEY }}
- id: create-comment
uses: actions/github-script@v7
Expand All @@ -78,7 +56,7 @@ jobs:
const { data: comment } = await github.rest.issues.createComment({
issue_number: context.payload.inputs.prNumber,
owner: context.repo.owner,
repo: 'vite',
repo: 'volar.js',
body: `⏳ Triggered ecosystem CI: ${urlLink}`
})
return comment.id
Expand Down Expand Up @@ -112,7 +90,7 @@ jobs:
run: |
ref=$(git log -1 --pretty=format:%H)
echo "ref=$ref" >> $GITHUB_OUTPUT
working-directory: workspace/vite
working-directory: workspace/volar

execute-all:
timeout-minutes: 30
Expand All @@ -124,32 +102,9 @@ jobs:
strategy:
matrix:
suite:
- analogjs
- astro
- histoire
# - iles # disabled until its CI is fixed
- ladle
- laravel
- marko
- nuxt
- nx
- previewjs
- qwik
- rakkas
- remix
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- unocss
- vike
- vite-plugin-pwa
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- mdx
- vue
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -173,7 +128,7 @@ jobs:
run: |
ref=$(git log -1 --pretty=format:%H)
echo "ref=$ref" >> $GITHUB_OUTPUT
working-directory: workspace/vite
working-directory: workspace/volar

update-comment:
runs-on: ubuntu-latest
Expand All @@ -184,13 +139,13 @@ jobs:
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.PR_GITHUB_APP_ID }}
installation_retrieval_payload: "${{ github.repository_owner }}/vite"
installation_retrieval_payload: "${{ github.repository_owner }}/volar.js"
private_key: ${{ secrets.PR_GITHUB_APP_PRIVATE_KEY }}
- uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const mainRepoName = 'vite'
const mainRepoName = 'volar.js'
const ref = "${{ needs.execute-all.outputs.ref }}" || "${{ needs.execute-selected-suite.outputs.ref }}"
const refLink = `[\`${ref.slice(0, 7)}\`](${context.serverUrl}/${context.repo.owner}/${mainRepoName}/pull/${context.payload.inputs.prNumber}/commits/${ref})`
Expand Down
41 changes: 9 additions & 32 deletions .github/workflows/ecosystem-ci-selected.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# integration tests for vite ecosystem - single run of selected testsuite
name: vite-ecosystem-ci-selected
# integration tests for volar ecosystem - single run of selected testsuite
name: volar-ecosystem-ci-selected

env:
# 7 GiB by default on GitHub, setting to 6 GiB
Expand All @@ -10,7 +10,7 @@ on:
workflow_dispatch:
inputs:
refType:
description: "type of vite ref to use"
description: "type of volar ref to use"
required: true
type: choice
options:
Expand All @@ -20,46 +20,23 @@ on:
- release
default: "branch"
ref:
description: "vite ref to use"
description: "volar ref to use"
required: true
type: string
default: "main"
default: "master"
repo:
description: "vite repository to use"
description: "volar repository to use"
required: true
type: string
default: "vitejs/vite"
default: "volarjs/volar.js"
suite:
description: "testsuite to run"
required: true
type: choice
options:
- analogjs
- astro
- histoire
# - iles # disabled until its CI is fixed
- ladle
- laravel
- marko
- nuxt
- nx
- previewjs
- qwik
- rakkas
- remix
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- unocss
- vike
- vite-plugin-pwa
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- mdx
- vue
jobs:
execute-selected-suite:
timeout-minutes: 30
Expand Down
47 changes: 12 additions & 35 deletions .github/workflows/ecosystem-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# integration tests for vite ecosystem projects - scheduled or manual run for all suites
name: vite-ecosystem-ci
# integration tests for volar ecosystem projects - scheduled or manual run for all suites
name: volar-ecosystem-ci

env:
# 7 GiB by default on GitHub, setting to 6 GiB
Expand All @@ -22,15 +22,15 @@ on:
- release
default: "branch"
ref:
description: "vite ref to use"
description: "volar ref to use"
required: true
type: string
default: "main"
default: "master"
repo:
description: "vite repository to use"
description: "volar repository to use"
required: true
type: string
default: "vitejs/vite"
default: "volarjs/volar.js"
repository_dispatch:
types: [ecosystem-ci]
jobs:
Expand All @@ -40,32 +40,9 @@ jobs:
strategy:
matrix:
suite:
- analogjs
- astro
- histoire
# - iles # disabled until its CI is fixed
- ladle
- laravel
- marko
- nuxt
- nx
- previewjs
- qwik
- rakkas
- remix
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- unocss
- vike
- vite-plugin-pwa
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- mdx
- vue
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -83,17 +60,17 @@ jobs:
- run: pnpm i --frozen-lockfile
- 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' }}
--${{ inputs.refType || github.event.client_payload.refType || 'branch' }} ${{ inputs.ref || github.event.client_payload.ref || 'master' }}
--repo ${{ inputs.repo || github.event.client_payload.repo || 'volarjs/volar.js' }}
${{ matrix.suite }}
id: ecosystem-ci-run
- if: always()
run: pnpm tsx discord-webhook.ts
env:
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' }}
REF: ${{ inputs.ref || github.event.client_payload.ref || 'master' }}
REPO: ${{ inputs.repo || github.event.client_payload.repo || 'volarjs/volar.js' }}
SUITE: ${{ matrix.suite }}
STATUS: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
.DS_Store
.DS_Store?
node_modules
vite
workspace
.pnpm-debug.log
.idea
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vite-ecosystem-ci
# volar-ecosystem-ci

This repository is used to run integration tests for vite ecosystem projects
This repository is used to run integration tests for volar ecosystem projects

## via github workflow

Expand All @@ -23,8 +23,8 @@ Workflows are scheduled to run automatically every Monday, Wednesday and Friday
- or `pnpm test <suitename>` to select a suite
- or `tsx ecosystem-ci.ts`

You can pass `--tag v2.8.0-beta.1`, `--branch somebranch` or `--commit abcd1234` option to select a specific vite version to build.
If you pass `--release 2.7.13`, vite build will be skipped and vite is fetched from the registry instead
You can pass `--tag v2.8.0-beta.1`, `--branch somebranch` or `--commit abcd1234` option to select a specific volar version to build.
If you pass `--release 2.7.13`, volar build will be skipped and volar is fetched from the registry instead

The repositories are checked out into `workspace` subdirectory as shallow clones

Expand All @@ -33,7 +33,7 @@ The repositories are checked out into `workspace` subdirectory as shallow clones
- comment `/ecosystem-ci run` on a PR
- or `/ecosystem-ci run <suitename>` to select a suite

Users with triage permission to vitejs/vite repository can only use this.
Users with triage permission to volarjs/volar.js repository can only use this.

See [docs/pr-comment-setup.md](./docs/pr-comment-setup.md) for how to setup this feature.

Expand All @@ -44,9 +44,9 @@ See [docs/pr-comment-setup.md](./docs/pr-comment-setup.md) for how to setup this

# reporting results

## Discord
<!-- ## Discord
Results are posted automatically to `#ecosystem-ci` on [vite discord](https://chat.vitejs.dev/)
Results are posted automatically to `#ecosystem-ci` on [vite discord](https://chat.vitejs.dev/) -->

### on your own server

Expand Down
30 changes: 30 additions & 0 deletions builds/services.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { runInRepo } from '../utils.ts'
import type { RunOptions } from '../types.d.ts'

export async function build(options: RunOptions) {
return runInRepo({
...options,
repo: 'volarjs/services',
build: 'build',
})
}

export const packages = {
'volar-service-css': 'packages/css',
'volar-service-emmet': 'packages/emmet',
'volar-service-html': 'packages/html',
'volar-service-json': 'packages/json',
'volar-service-markdown': 'packages/markdown',
'volar-service-prettier': 'packages/prettier',
'volar-service-pretty-ts-errors': 'packages/pretty-ts-errors',
'volar-service-prettyhtml': 'packages/prettyhtml',
'volar-service-pug-beautify': 'packages/pug-beautify',
'volar-service-pug': 'packages/pug',
'volar-service-sass-formatter': 'packages/sass-formatter',
'volar-service-tsconfig': 'packages/tsconfig',
'volar-service-typescript-twoslash-queries':
'packages/typescript-twoslash-queries',
'volar-service-typescript': 'packages/typescript',
'volar-service-vetur': 'packages/vetur',
'volar-service-yaml': 'packages/yaml',
}
14 changes: 0 additions & 14 deletions builds/vite-plugin-react.ts

This file was deleted.

Loading

0 comments on commit cf1cd10

Please sign in to comment.