2023-12-20 22:18:31 +00:00
|
|
|
name: ci
|
2021-08-09 17:30:25 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-03-16 13:58:53 +00:00
|
|
|
paths-ignore:
|
2022-10-17 10:10:05 +00:00
|
|
|
- "docs/**"
|
2023-06-27 11:27:11 +00:00
|
|
|
- "*.md"
|
2021-08-09 17:30:25 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2024-06-19 17:16:04 +00:00
|
|
|
- 3.x
|
2021-08-09 17:30:25 +00:00
|
|
|
pull_request:
|
2022-03-16 13:58:53 +00:00
|
|
|
paths-ignore:
|
2022-10-17 10:10:05 +00:00
|
|
|
- "docs/**"
|
2023-06-27 11:27:11 +00:00
|
|
|
- "*.md"
|
2021-08-09 17:30:25 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2024-06-19 17:16:04 +00:00
|
|
|
- 3.x
|
2023-04-20 08:47:03 +00:00
|
|
|
- "!v[0-9]*"
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-02-13 22:09:32 +00:00
|
|
|
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml
|
|
|
|
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
|
2022-02-21 10:26:51 +00:00
|
|
|
|
2023-02-13 22:09:32 +00:00
|
|
|
# Remove default permissions of GITHUB_TOKEN for security
|
|
|
|
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
|
|
|
|
permissions: {}
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
|
|
|
cancel-in-progress: ${{ github.event_name != 'push' }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2022-08-25 08:59:59 +00:00
|
|
|
timeout-minutes: 10
|
|
|
|
|
2022-02-21 10:26:51 +00:00
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2022-10-17 10:10:05 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2022-02-21 10:26:51 +00:00
|
|
|
with:
|
2023-09-11 22:46:22 +00:00
|
|
|
node-version: 20
|
2022-10-17 10:10:05 +00:00
|
|
|
cache: "pnpm"
|
2022-02-21 10:26:51 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm install
|
2022-02-21 10:26:51 +00:00
|
|
|
|
2023-03-12 22:16:43 +00:00
|
|
|
- name: Build (stub)
|
2023-12-19 12:21:11 +00:00
|
|
|
run: pnpm dev:prepare
|
2023-03-12 22:15:06 +00:00
|
|
|
|
2023-03-12 22:10:30 +00:00
|
|
|
- name: Typecheck
|
|
|
|
run: pnpm typecheck
|
|
|
|
|
2022-02-21 10:26:51 +00:00
|
|
|
- name: Build
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm build
|
2022-02-21 10:26:51 +00:00
|
|
|
|
|
|
|
- name: Cache dist
|
2024-08-07 10:00:23 +00:00
|
|
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
2022-02-21 10:26:51 +00:00
|
|
|
with:
|
2023-02-20 09:54:48 +00:00
|
|
|
retention-days: 3
|
2023-02-13 22:09:32 +00:00
|
|
|
name: dist
|
2022-02-21 10:26:51 +00:00
|
|
|
path: packages/*/dist
|
|
|
|
|
2023-06-02 17:14:21 +00:00
|
|
|
codeql:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
needs:
|
2023-12-21 14:59:23 +00:00
|
|
|
- build
|
2023-06-02 17:14:21 +00:00
|
|
|
|
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-06-02 17:14:21 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2023-06-02 17:14:21 +00:00
|
|
|
with:
|
2023-09-11 22:46:22 +00:00
|
|
|
node-version: 20
|
2023-06-02 17:14:21 +00:00
|
|
|
cache: "pnpm"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Initialize CodeQL
|
2024-08-16 10:40:09 +00:00
|
|
|
uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
|
2023-06-02 17:14:21 +00:00
|
|
|
with:
|
|
|
|
languages: javascript
|
|
|
|
queries: +security-and-quality
|
|
|
|
|
|
|
|
- name: Restore dist cache
|
2024-07-05 17:21:38 +00:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2023-06-02 17:14:21 +00:00
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
path: packages
|
|
|
|
|
|
|
|
- name: Perform CodeQL Analysis
|
2024-08-16 10:40:09 +00:00
|
|
|
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
|
2023-06-02 17:14:21 +00:00
|
|
|
with:
|
|
|
|
category: "/language:javascript"
|
|
|
|
|
2023-03-17 15:24:39 +00:00
|
|
|
typecheck:
|
2023-06-19 22:29:09 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-03-17 15:24:39 +00:00
|
|
|
timeout-minutes: 10
|
|
|
|
needs:
|
|
|
|
- build
|
2023-05-04 09:38:02 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-06-19 22:29:09 +00:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2023-12-21 14:59:23 +00:00
|
|
|
module: ["bundler", "node"]
|
2023-03-17 15:24:39 +00:00
|
|
|
|
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-03-17 15:24:39 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2023-03-17 15:24:39 +00:00
|
|
|
with:
|
2023-09-11 22:46:22 +00:00
|
|
|
node-version: 20
|
2023-03-17 15:24:39 +00:00
|
|
|
cache: "pnpm"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Restore dist cache
|
2024-07-05 17:21:38 +00:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2023-03-17 15:24:39 +00:00
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
path: packages
|
|
|
|
|
|
|
|
- name: Test (types)
|
|
|
|
run: pnpm test:types
|
2023-05-04 09:38:02 +00:00
|
|
|
env:
|
|
|
|
MODULE_RESOLUTION: ${{ matrix.module }}
|
2023-03-17 15:24:39 +00:00
|
|
|
|
2024-02-15 10:07:39 +00:00
|
|
|
- name: Typecheck (docs)
|
|
|
|
run: pnpm typecheck:docs
|
|
|
|
|
2021-08-09 17:30:25 +00:00
|
|
|
lint:
|
2023-04-04 13:39:10 +00:00
|
|
|
# autofix workflow will be triggered instead for PRs
|
|
|
|
if: github.event_name == 'push'
|
2023-02-13 22:09:32 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-08-25 08:59:59 +00:00
|
|
|
timeout-minutes: 10
|
|
|
|
|
2021-08-09 17:30:25 +00:00
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2022-10-17 10:10:05 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2021-08-09 17:30:25 +00:00
|
|
|
with:
|
2023-09-11 22:46:22 +00:00
|
|
|
node-version: 20
|
2022-10-17 10:10:05 +00:00
|
|
|
cache: "pnpm"
|
2021-08-09 17:30:25 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm install
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-04-06 12:55:12 +00:00
|
|
|
- name: Build (stub)
|
2023-12-19 12:21:11 +00:00
|
|
|
run: pnpm dev:prepare
|
2023-04-06 12:55:12 +00:00
|
|
|
|
2021-08-09 17:30:25 +00:00
|
|
|
- name: Lint
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm lint
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-12-11 18:20:11 +00:00
|
|
|
test-unit:
|
|
|
|
# autofix workflow will be triggered instead for PRs
|
|
|
|
if: github.event_name == 'push'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-12-11 18:20:11 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2023-12-11 18:20:11 +00:00
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
cache: "pnpm"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Build (stub)
|
2023-12-19 12:21:11 +00:00
|
|
|
run: pnpm dev:prepare
|
2023-12-11 18:20:11 +00:00
|
|
|
|
|
|
|
- name: Test (unit)
|
|
|
|
run: pnpm test:unit
|
|
|
|
|
|
|
|
- name: Test (runtime unit)
|
|
|
|
run: pnpm test:runtime
|
|
|
|
|
2022-02-18 18:14:57 +00:00
|
|
|
test-fixtures:
|
2021-08-09 17:30:25 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-03-17 15:24:39 +00:00
|
|
|
needs:
|
|
|
|
- build
|
2021-08-09 17:30:25 +00:00
|
|
|
|
|
|
|
strategy:
|
2023-02-13 22:09:32 +00:00
|
|
|
fail-fast: false
|
2021-08-09 17:30:25 +00:00
|
|
|
matrix:
|
2022-03-16 13:41:37 +00:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2023-12-21 14:59:23 +00:00
|
|
|
env: ["dev", "built"]
|
|
|
|
builder: ["vite", "webpack"]
|
|
|
|
context: ["async", "default"]
|
|
|
|
manifest: ["manifest-on", "manifest-off"]
|
2024-04-30 19:34:32 +00:00
|
|
|
version: ["v4", "v3"]
|
2024-05-09 20:47:31 +00:00
|
|
|
payload: ["json", "js"]
|
2023-09-11 13:05:14 +00:00
|
|
|
node: [18]
|
2023-02-13 22:09:32 +00:00
|
|
|
exclude:
|
2024-05-09 20:47:31 +00:00
|
|
|
- builder: "webpack"
|
|
|
|
payload: "js"
|
|
|
|
- manifest: "manifest-off"
|
|
|
|
payload: "js"
|
|
|
|
- context: "default"
|
|
|
|
payload: "js"
|
|
|
|
- os: windows-latest
|
|
|
|
payload: "js"
|
2023-12-21 14:59:23 +00:00
|
|
|
- env: "dev"
|
|
|
|
builder: "webpack"
|
|
|
|
- manifest: "manifest-off"
|
|
|
|
builder: "webpack"
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-08-15 09:45:28 +00:00
|
|
|
timeout-minutes: 15
|
2022-08-25 08:59:59 +00:00
|
|
|
|
2021-08-09 17:30:25 +00:00
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2022-10-17 10:10:05 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2021-08-09 17:30:25 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2022-10-17 10:10:05 +00:00
|
|
|
cache: "pnpm"
|
2021-08-09 17:30:25 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Install Playwright
|
2023-07-13 17:26:04 +00:00
|
|
|
run: pnpm playwright-core install chromium
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-03-17 15:24:39 +00:00
|
|
|
- name: Restore dist cache
|
2024-07-05 17:21:38 +00:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2023-03-17 15:24:39 +00:00
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
path: packages
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2022-02-18 18:14:57 +00:00
|
|
|
- name: Test (fixtures)
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm test:fixtures
|
2022-04-07 19:15:30 +00:00
|
|
|
env:
|
2023-02-13 22:09:32 +00:00
|
|
|
TEST_ENV: ${{ matrix.env }}
|
|
|
|
TEST_BUILDER: ${{ matrix.builder }}
|
2023-09-19 21:31:18 +00:00
|
|
|
TEST_MANIFEST: ${{ matrix.manifest }}
|
2023-08-08 09:45:37 +00:00
|
|
|
TEST_CONTEXT: ${{ matrix.context }}
|
2024-04-30 19:34:32 +00:00
|
|
|
TEST_V4: ${{ matrix.version == 'v4' }}
|
2024-05-09 20:47:31 +00:00
|
|
|
TEST_PAYLOAD: ${{ matrix.payload }}
|
2024-05-16 14:14:25 +00:00
|
|
|
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || matrix.payload == 'js' || runner.os == 'Windows' }}
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
|
2023-11-14 12:44:39 +00:00
|
|
|
if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on'
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|
2021-08-09 17:30:25 +00:00
|
|
|
build-release:
|
2024-06-29 21:31:50 +00:00
|
|
|
concurrency:
|
|
|
|
group: release
|
2023-04-20 19:55:06 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
2022-03-16 13:58:53 +00:00
|
|
|
if: |
|
|
|
|
github.event_name == 'push' &&
|
2024-01-20 22:07:07 +00:00
|
|
|
github.repository == 'nuxt/nuxt' &&
|
2022-03-16 13:58:53 +00:00
|
|
|
!contains(github.event.head_commit.message, '[skip-release]') &&
|
2023-12-01 09:57:47 +00:00
|
|
|
!startsWith(github.event.head_commit.message, 'chore') &&
|
|
|
|
!startsWith(github.event.head_commit.message, 'docs')
|
2021-08-09 17:30:25 +00:00
|
|
|
needs:
|
|
|
|
- lint
|
2022-02-21 10:26:51 +00:00
|
|
|
- build
|
2022-02-18 18:14:57 +00:00
|
|
|
- test-fixtures
|
2023-05-16 08:52:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 20
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-05-16 08:52:24 +00:00
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-05-16 08:52:24 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2023-05-16 08:52:24 +00:00
|
|
|
with:
|
2023-09-11 22:46:22 +00:00
|
|
|
node-version: 20
|
2023-05-16 08:52:24 +00:00
|
|
|
cache: "pnpm"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Restore dist cache
|
2024-07-05 17:21:38 +00:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2023-05-16 08:52:24 +00:00
|
|
|
with:
|
|
|
|
name: dist
|
|
|
|
path: packages
|
|
|
|
|
|
|
|
- name: Release Edge
|
2024-06-19 15:45:20 +00:00
|
|
|
run: ./scripts/release-edge.sh ${{ github.ref == 'refs/heads/main' && 'latest' || '3x' }}
|
2023-05-16 08:52:24 +00:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
|
|
|
NPM_CONFIG_PROVENANCE: true
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2023-05-16 08:52:24 +00:00
|
|
|
release-pr:
|
2024-06-29 21:31:50 +00:00
|
|
|
concurrency:
|
|
|
|
group: release
|
2023-05-16 08:52:24 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
pull-requests: write
|
|
|
|
if: |
|
|
|
|
github.event_name == 'pull_request' &&
|
|
|
|
contains(github.event.pull_request.labels.*.name, '🧷 edge release')
|
|
|
|
needs:
|
|
|
|
- lint
|
|
|
|
- build
|
|
|
|
- test-fixtures
|
|
|
|
runs-on: ubuntu-latest
|
2022-08-25 08:59:59 +00:00
|
|
|
timeout-minutes: 20
|
|
|
|
|
2021-08-09 17:30:25 +00:00
|
|
|
steps:
|
2024-06-13 12:37:54 +00:00
|
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-03-03 10:45:47 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-10-17 10:10:05 +00:00
|
|
|
- run: corepack enable
|
2024-07-18 14:56:19 +00:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
2021-08-09 17:30:25 +00:00
|
|
|
with:
|
2023-09-11 22:46:22 +00:00
|
|
|
node-version: 20
|
2022-10-17 10:10:05 +00:00
|
|
|
cache: "pnpm"
|
2021-08-09 17:30:25 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-10-17 10:10:05 +00:00
|
|
|
run: pnpm install
|
2021-08-09 17:30:25 +00:00
|
|
|
|
2022-02-21 10:26:51 +00:00
|
|
|
- name: Restore dist cache
|
2024-07-05 17:21:38 +00:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2022-02-21 10:26:51 +00:00
|
|
|
with:
|
2023-02-13 22:09:32 +00:00
|
|
|
name: dist
|
|
|
|
path: packages
|
2021-08-09 17:30:25 +00:00
|
|
|
|
|
|
|
- name: Release Edge
|
2023-05-16 08:52:24 +00:00
|
|
|
run: ./scripts/release-edge.sh pr-${{ github.event.issue.number }}
|
2021-08-09 17:30:25 +00:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
|
2023-04-20 19:55:06 +00:00
|
|
|
NPM_CONFIG_PROVENANCE: true
|