diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39f27a5..86803fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,5 @@ name: 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: push: branches: @@ -41,9 +32,3 @@ jobs: run: pnpm run lint - name: typecheck run: pnpm run typecheck - - name: audit - if: (${{ success() }} || ${{ failure() }}) - run: pnpm audit - - name: test - if: (${{ success() }} || ${{ failure() }}) - run: pnpm test:self diff --git a/.github/workflows/ecosystem-ci-from-pr.yml b/.github/workflows/ecosystem-ci-from-pr.yml deleted file mode 100644 index b7b57d3..0000000 --- a/.github/workflows/ecosystem-ci-from-pr.yml +++ /dev/null @@ -1,311 +0,0 @@ -# integration tests for vite ecosystem - run from pr comments -name: vite-ecosystem-ci-from-pr - -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: - workflow_dispatch: - inputs: - prNumber: - description: "PR number (e.g. 9887)" - required: true - type: string - branchName: - description: "vite branch to use" - required: true - type: string - default: "main" - repo: - description: "vite repository to use" - required: true - type: string - default: "vitejs/vite" - suite: - description: "testsuite to run. runs all testsuits when `-`." - required: false - type: choice - options: - - "-" - - analogjs - - astro - - histoire - - hydrogen - - iles - - ladle - - laravel - - marko - - nuxt - - nx - - previewjs - - quasar - - qwik - - rakkas - - redwoodjs - - storybook - - sveltekit - - unocss - - vike - - vite-environment-examples - - 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 - - vuepress -jobs: - init: - runs-on: ubuntu-latest - outputs: - comment-id: ${{ steps.create-comment.outputs.result }} - steps: - - id: generate-token - uses: tibdex/github-app-token@v2 - with: - app_id: ${{ secrets.PR_GITHUB_APP_ID }} - installation_retrieval_payload: "${{ github.repository_owner }}/vite" - private_key: ${{ secrets.PR_GITHUB_APP_PRIVATE_KEY }} - - id: create-comment - uses: actions/github-script@v7 - with: - github-token: ${{ steps.generate-token.outputs.token }} - result-encoding: string - script: | - const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` - const urlLink = `[Open](${url})` - - const { data: comment } = await github.rest.issues.createComment({ - issue_number: context.payload.inputs.prNumber, - owner: context.repo.owner, - repo: 'vite', - body: `⏳ Triggered ecosystem CI: ${urlLink}` - }) - return comment.id - - execute-selected-suite: - timeout-minutes: 30 - runs-on: ubuntu-latest - needs: init - if: "inputs.suite != '-'" - outputs: - ref: ${{ steps.get-ref.outputs.ref }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - continue-on-error: true - - run: corepack enable - - run: pnpm --version - - run: pnpm i --frozen-lockfile - - run: >- - pnpm tsx ecosystem-ci.ts - --branch ${{ inputs.branchName }} - --repo ${{ inputs.repo }} - ${{ inputs.suite }} - - id: get-ref - if: always() - run: | - ref=$(git log -1 --pretty=format:%H) - echo "ref=$ref" >> $GITHUB_OUTPUT - working-directory: workspace/vite - - execute-all: - timeout-minutes: 30 - runs-on: ubuntu-latest - needs: init - if: "inputs.suite == '-'" - outputs: - ref: ${{ steps.get-ref.outputs.ref }} - 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 - fail-fast: false - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - continue-on-error: true - - run: corepack enable - - run: pnpm --version - - run: pnpm i --frozen-lockfile - - run: >- - pnpm tsx ecosystem-ci.ts - --branch ${{ inputs.branchName }} - --repo ${{ inputs.repo }} - ${{ matrix.suite }} - - id: get-ref - if: always() - run: | - ref=$(git log -1 --pretty=format:%H) - echo "ref=$ref" >> $GITHUB_OUTPUT - working-directory: workspace/vite - - update-comment: - runs-on: ubuntu-latest - needs: [init, execute-selected-suite, execute-all] - if: always() - steps: - - id: generate-token - uses: tibdex/github-app-token@v2 - with: - app_id: ${{ secrets.PR_GITHUB_APP_ID }} - installation_retrieval_payload: "${{ github.repository_owner }}/vite" - 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 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})` - - const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.runId, - per_page: 100 - }); - - const selectedSuite = context.payload.inputs.suite - let results - if (selectedSuite !== "-") { - const { conclusion, html_url } = jobs.find(job => job.name === "execute-selected-suite") - results = [{ suite: selectedSuite, conclusion, link: html_url }] - } else { - results = jobs - .filter(job => job.name.startsWith('execute-all ')) - .map(job => { - const suite = job.name.replace(/^execute-all \(([^)]+)\)$/, "$1") - return { suite, conclusion: job.conclusion, link: job.html_url } - }) - } - - const url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` - const urlLink = `[Open](${url})` - - const conclusionEmoji = { - success: ":white_check_mark:", - failure: ":x:", - cancelled: ":stop_button:" - } - - // check for previous ecosystem-ci runs against the main branch - - // first, list workflow runs for ecosystem-ci.yml - const { data: { workflow_runs } } = await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'ecosystem-ci.yml' - }); - - // for simplity, we only take the latest completed scheduled run - // otherwise we would have to check the inputs for every maunally triggerred runs, which is an overkill - const latestScheduledRun = workflow_runs.find(run => run.event === "schedule" && run.status === "completed") - - // get the jobs for the latest scheduled run - const { data: { jobs: scheduledJobs } } = await github.rest.actions.listJobsForWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: latestScheduledRun.id - }); - const scheduledResults = scheduledJobs - .filter(job => job.name.startsWith('test-ecosystem ')) - .map(job => { - const suite = job.name.replace(/^test-ecosystem \(([^)]+)\)$/, "$1") - return { suite, conclusion: job.conclusion, link: job.html_url } - }) - - const rows = [] - const successfulSuitesWithoutChanges = [] - results.forEach(current => { - const latest = scheduledResults.find(s => s.suite === current.suite) || {} // in case a new suite is added after latest scheduled - - if (current.conclusion === "success" && latest.conclusion === "success") { - successfulSuitesWithoutChanges.push(`[${current.suite}](${current.link})`) - } - else { - const firstColumn = current.suite - const secondColumn = `${conclusionEmoji[current.conclusion]} [${current.conclusion}](${current.link})` - const thirdColumn = `${conclusionEmoji[latest.conclusion]} [${latest.conclusion}](${latest.link})` - - rows.push(`| ${firstColumn} | ${secondColumn} | ${thirdColumn} |`) - } - }) - - let body = ` - 📝 Ran ecosystem CI on ${refLink}: ${urlLink} - - ` - if (rows.length > 0) { - body += `| suite | result | [latest scheduled](${latestScheduledRun.html_url}) | - |-------|--------|----------------| - ${rows.join("\n")} - - ${conclusionEmoji.success} ${successfulSuitesWithoutChanges.join(", ")} - ` - } else { - body += `${conclusionEmoji.success} ${successfulSuitesWithoutChanges.join(", ")} - ` - } - - await github.rest.issues.createComment({ - issue_number: context.payload.inputs.prNumber, - owner: context.repo.owner, - repo: mainRepoName, - body - }) - - await github.rest.issues.deleteComment({ - owner: context.repo.owner, - repo: mainRepoName, - comment_id: ${{ needs.init.outputs.comment-id }} - }) diff --git a/.github/workflows/ecosystem-ci-selected.yml b/.github/workflows/ecosystem-ci-selected.yml index b6dc8fd..a3a28ac 100644 --- a/.github/workflows/ecosystem-ci-selected.yml +++ b/.github/workflows/ecosystem-ci-selected.yml @@ -1,5 +1,5 @@ -# integration tests for vite ecosystem - single run of selected testsuite -name: vite-ecosystem-ci-selected +# integration tests for qwik ecosystem - single run of selected testsuite +name: qwik-ecosystem-ci-selected env: # 7 GiB by default on GitHub, setting to 6 GiB @@ -14,7 +14,7 @@ on: workflow_dispatch: inputs: refType: - description: "type of vite ref to use" + description: "type of qwik ref to use" required: true type: choice options: @@ -24,51 +24,21 @@ 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" suite: description: "testsuite to run" required: true type: choice options: - - analogjs - - astro - - histoire - - hydrogen - - iles - - ladle - - laravel - - marko - - nuxt - - nx - - previewjs - - quasar - - qwik - - rakkas - - redwoodjs - - remix - - storybook - - sveltekit - - unocss - - vike - - vite-environment-examples - - 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 - - vuepress + - qwik-ui-headless jobs: execute-selected-suite: timeout-minutes: 30 @@ -79,11 +49,7 @@ jobs: with: node-version: 20 id: setup-node - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - id: setup-deno - continue-on-error: true + - run: curl https://sh.rustup.rs -sSf | sh -s -- -y - run: corepack enable - run: pnpm --version - run: pnpm i --frozen-lockfile @@ -93,14 +59,3 @@ jobs: --repo ${{ inputs.repo }} ${{ inputs.suite }} id: ecosystem-ci-run - - if: always() - run: pnpm tsx discord-webhook.ts - env: - WORKFLOW_NAME: ci-selected - REF_TYPE: ${{ inputs.refType }} - REF: ${{ inputs.ref }} - REPO: ${{ inputs.repo }} - SUITE: ${{ inputs.suite }} - STATUS: ${{ job.status }} - DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ecosystem-ci.yml b/.github/workflows/ecosystem-ci.yml index 2dd2753..93464fe 100644 --- a/.github/workflows/ecosystem-ci.yml +++ b/.github/workflows/ecosystem-ci.yml @@ -5,6 +5,8 @@ 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 + # Disable incremental build, speeds up CI + CARGO_INCREMENTAL: 0 on: schedule: @@ -47,12 +49,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - id: setup-node - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - id: setup-deno - continue-on-error: true + id: setup-node + - name: Install Rust toolchain + run: curl https://sh.rustup.rs -sSf | sh -s -- -y - run: corepack enable - run: pnpm --version - run: pnpm i --frozen-lockfile @@ -62,14 +61,3 @@ jobs: --repo ${{ inputs.repo || github.event.client_payload.repo || 'QwikDev/qwik' }} ${{ 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 || 'QwikDev/qwik' }} - SUITE: ${{ matrix.suite }} - STATUS: ${{ job.status }} - DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index b21aff8..9c18efc 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "vite-ecosystem-ci", + "name": "qwik-ecosystem-ci", "private": true, "version": "0.0.1", - "description": "Vite Ecosystem CI", + "description": "Qwik Ecosystem CI", "scripts": { "prepare": "pnpm exec simple-git-hooks", "lint": "eslint --ignore-path .gitignore '**/*.ts'", @@ -33,13 +33,13 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/vitejs/vite-ecosystem-ci.git" + "url": "git+https://github.com/qwikdev/qwik-ecosystem-ci.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/vitejs/vite-ecosystem-ci/issues" + "url": "https://github.com/qwikdev/qwik-ecosystem-ci/issues" }, - "homepage": "https://github.com/vitejs/vite-ecosystem-ci#readme", + "homepage": "https://github.com/qwikdev/qwik-ecosystem-ci#readme", "dependencies": { "@actions/core": "^1.10.1", "cac": "^6.7.14",