Skip to content

Commit

Permalink
chore: split ci jobs for faster docs & template updates (#11294)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Dec 17, 2022
1 parent 274d1f3 commit d2ba095
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 38 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/ci-lint.yml
@@ -0,0 +1,70 @@
name: CI Lint

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

on:
push:
branches:
- main
- release/*
- feat/*
- fix/*
- perf/*
- v1
- v2
- v2.*
- v3.*
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Lint, Format, Typecheck, Docs"
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4

- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Lint
run: pnpm run lint

- name: Check formatting
run: pnpm prettier --check .

- name: Typecheck
run: pnpm run typecheck

# Run unit test for create-vite only PRs
- name: Test unit
run: pnpm run test-unit

- name: Test docs
run: pnpm run test-docs

# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: Check workflow files
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -shellcheck=""
40 changes: 3 additions & 37 deletions .github/workflows/ci.yml
Expand Up @@ -22,6 +22,9 @@ on:
- v2.*
- v3.*
pull_request:
paths-ignore:
- "docs/**"
- "packages/create-vite/**"
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -98,40 +101,3 @@ jobs:

- name: Test build
run: pnpm run test-build

- name: Test docs
run: pnpm run test-docs

lint:
if: github.repository == 'vitejs/vite'
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Lint: node-16, ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4

- name: Set node version to 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Lint
run: pnpm run lint

- name: Check formatting
run: pnpm prettier --check .

- name: Typecheck
run: pnpm run typecheck
2 changes: 1 addition & 1 deletion .github/workflows/release-tag.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
pkgName=${GITHUB_REF_NAME%@*}
fi
echo "::set-output name=pkgName::$pkgName"
echo "pkgName=$pkgName" >> $GITHUB_OUTPUT
- name: Create Release for Tag
id: release_tag
Expand Down

0 comments on commit d2ba095

Please sign in to comment.