Skip to content

Commit

Permalink
refactor!(work-in-progress): setup vue ecosystem ci
Browse files Browse the repository at this point in the history
Caveat:

Unlike `vite`, which is used as a build tool, symlinking an actual
project dependency like `vue` brings in a lot of complexity.

So the tests are currently failing and we need to later refactor the
linking process to `pack` and `install`.
  • Loading branch information
haoqunjiang committed Jan 13, 2023
1 parent 659771e commit 2705693
Show file tree
Hide file tree
Showing 39 changed files with 146 additions and 630 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
/* eslint-disable @typescript-eslint/no-var-requires, n/no-unpublished-require */
const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
Expand Down
56 changes: 9 additions & 47 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 vue ecosystem - run from pr comments
name: ecosystem-ci-from-pr

env:
# 7 GiB by default on GitHub, setting to 6 GiB
Expand All @@ -14,43 +14,24 @@ on:
required: true
type: string
branchName:
description: "vite branch to use"
description: "vue branch to use"
required: true
type: string
default: "main"
repo:
description: "vite repository to use"
description: "vue repository to use"
required: true
type: string
default: "vitejs/vite"
default: "vuejs/core"
suite:
description: "testsuite to run. runs all testsuits when `-`."
required: false
type: choice
options:
- "-"
- astro
- histoire
- iles
- ladle
- laravel
- marko
- nuxt-framework
- previewjs
- qwik
- rakkas
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- vite-plugin-ssr
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- windicss
jobs:
init:
runs-on: ubuntu-latest
Expand All @@ -62,7 +43,7 @@ jobs:
with:
app_id: ${{ secrets.PR_GITHUB_APP_ID }}
private_key: ${{ secrets.PR_GITHUB_APP_PRIVATE_KEY }}
repository: "${{ github.repository_owner }}/vite"
repository: "${{ github.repository_owner }}/core"
- id: create-comment
uses: actions/github-script@v6
with:
Expand All @@ -75,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: 'core',
body: `⏳ Triggered ecosystem CI: ${urlLink}`
})
return comment.id
Expand Down Expand Up @@ -111,28 +92,9 @@ jobs:
strategy:
matrix:
suite:
- astro
- histoire
- iles
- ladle
- laravel
- marko
- nuxt-framework
- previewjs
- qwik
- rakkas
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- vite-plugin-ssr
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- windicss
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -162,7 +124,7 @@ jobs:
with:
app_id: ${{ secrets.PR_GITHUB_APP_ID }}
private_key: ${{ secrets.PR_GITHUB_APP_PRIVATE_KEY }}
repository: "${{ github.repository_owner }}/vite"
repository: "${{ github.repository_owner }}/core"
- uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
Expand Down Expand Up @@ -207,7 +169,7 @@ jobs:
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: 'vite',
repo: 'core',
comment_id: ${{ needs.init.outputs.comment-id }},
body
})
31 changes: 6 additions & 25 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 vue ecosystem - single run of selected testsuite
name: 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 vue ref to use"
required: true
type: choice
options:
Expand All @@ -20,42 +20,23 @@ on:
- release
default: "branch"
ref:
description: "vite ref to use"
description: "vue ref to use"
required: true
type: string
default: "main"
repo:
description: "vite repository to use"
description: "vue repository to use"
required: true
type: string
default: "vitejs/vite"
default: "vuejs/core"
suite:
description: "testsuite to run"
required: true
type: choice
options:
- astro
- histoire
- iles
- ladle
- laravel
- marko
- nuxt-framework
- previewjs
- qwik
- rakkas
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- vite-plugin-ssr
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- windicss
jobs:
execute-selected-suite:
timeout-minutes: 30
Expand Down
33 changes: 7 additions & 26 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 vue ecosystem projects - scheduled or manual run for all suites
name: 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: "vue ref to use"
required: true
type: string
default: "main"
repo:
description: "vite repository to use"
description: "vue repository to use"
required: true
type: string
default: "vitejs/vite"
default: "vuejs/core"
repository_dispatch:
types: [ecosystem-ci]
jobs:
Expand All @@ -40,28 +40,9 @@ jobs:
strategy:
matrix:
suite:
- astro
- histoire
- iles
- ladle
- laravel
- marko
- nuxt-framework
- previewjs
- qwik
- rakkas
# - storybook # disabled until test is updated, see https://github.com/vitejs/vite-ecosystem-ci/issues/130
- sveltekit
- vite-plugin-ssr
- vite-plugin-react
- vite-plugin-react-pages
- vite-plugin-react-swc
- vite-plugin-svelte
- vite-plugin-vue
- vite-setup-catalogue
- vitepress
- vitest
- windicss
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand All @@ -80,7 +61,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 || 'vuejs/core' }}
${{ matrix.suite }}
id: ecosystem-ci-run
- if: always()
Expand All @@ -89,7 +70,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 || 'vuejs/core' }}
SUITE: ${{ matrix.suite }}
STATUS: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.DS_Store
.DS_Store?
node_modules
vite
core
vue
workspace
.pnpm-debug.log
.idea
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MIT License

Copyright (c) 2023-present, Vue contributors
Copyright (c) 2021-present, Vite contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vite-ecosystem-ci
# Vue Ecosystem CI

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

## via github workflow

Expand All @@ -23,23 +23,19 @@ Workflows are sheduled 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 v3.2.0-beta.1`, `--branch somebranch` or `--commit abcd1234` option to select a specific vue version to build.
If you pass `--release 3.2.45`, vue build will be skipped and vue is fetched from the registry instead

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

# how to add a new integration test
## how to add a new integration test

- check out the existing [tests](./tests) and add one yourself. Thanks to some utilities it is really easy
- once you are confidente the suite works, add it to the lists of suites in the [workflows](../../actions/)

> the current utilities focus on pnpm based projects. Consider switching to pnpm or contribute utilities for other pms
# reporting results

## Discord

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

### on your own server

Expand All @@ -48,7 +44,7 @@ Results are posted automatically to `#ecosystem-ci` on [vite discord](https://ch
- copy the webhook url
- get in touch with admins of this repo so they can add the webhook

#### how to add a discord webhook here
### how to add a discord webhook here

- Go to `<github repo>/settings/secrets/actions` and click on `New repository secret`
- set `Name` as `DISCORD_WEBHOOK_URL`
Expand Down
14 changes: 0 additions & 14 deletions builds/vite-plugin-react.ts

This file was deleted.

18 changes: 0 additions & 18 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.

Loading

0 comments on commit 2705693

Please sign in to comment.