From 9d8d6a82f4efebc4cde85d0a54752c239c6fa6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Fri, 9 Dec 2022 23:43:52 +0100 Subject: [PATCH 1/3] chore: split ci jobs for faster docs & template updates --- .github/workflows/ci-lint.yml | 57 +++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 40 ++---------------------- 2 files changed, 60 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/ci-lint.yml diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml new file mode 100644 index 00000000000000..321707898801d4 --- /dev/null +++ b/.github/workflows/ci-lint.yml @@ -0,0 +1,57 @@ +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 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: "pnpm" + + - name: Install deps + run: pnpm install + + - name: Lint + run: pnpm run lint + + - name: Check formatting + run: pnpm prettier --check . + + - name: Typecheck + run: pnpm run typecheck + + - name: Test docs + run: pnpm run test-docs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0628dc82dc23e9..7dcefa03463b04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,9 @@ on: - v2.* - v3.* pull_request: + paths-ignore: + - "docs/**" + - "packages/create-vite/**" workflow_dispatch: concurrency: @@ -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 From 31ed3598c5aef15e745905cba06e5910235997d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Fri, 9 Dec 2022 23:54:37 +0100 Subject: [PATCH 2/3] fix: require build --- .github/workflows/ci-lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 321707898801d4..1fd7bfa659fa46 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -44,6 +44,9 @@ jobs: - name: Install deps run: pnpm install + - name: Build + run: pnpm run build + - name: Lint run: pnpm run lint From 675177f917c2016d22ef2f66b9673cb2807fa3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Wed, 14 Dec 2022 22:12:26 +0100 Subject: [PATCH 3/3] chore: node 18, run unit tests & lint workflow files --- .github/workflows/ci-lint.yml | 14 ++++++++++++-- .github/workflows/release-tag.yml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 1fd7bfa659fa46..94bd70c65948aa 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -35,10 +35,10 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2.2.4 - - name: Set node version to 16 + - name: Set node version to 18 uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: "pnpm" - name: Install deps @@ -56,5 +56,15 @@ jobs: - 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="" diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index 909160879c8559..e6bd45ddad8817 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -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