Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge back CI jobs using tj-actions/changed-files #11548

Merged
merged 8 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/ci-lint.yml

This file was deleted.

80 changes: 76 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,41 @@ on:
- v2.*
- v3.*
pull_request:
paths-ignore:
- "docs/**"
- "packages/create-vite/**"
workflow_dispatch:

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

jobs:
build:
diff:
timeout-minutes: 2
runs-on: ubuntu-latest
name: "Diff files"
outputs:
runTest: ${{ steps.skip-tests-files.outputs.only_changed != 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Assume PRs are less than 50 commits
fetch-depth: 50

- name: Get changed files
id: skip-tests-files
uses: tj-actions/changed-files@v35
ArnaudBarre marked this conversation as resolved.
Show resolved Hide resolved
with:
files: |
docs/**
.github/**
!.github/workflows/ci.yml
packages/create-vite/**
!packages/create-vite/__tests__/**
**/*.md
sapphi-red marked this conversation as resolved.
Show resolved Hide resolved

test:
needs: diff
if: ${{ needs.diff.outputs.runTest }}
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -52,6 +76,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: |
docs/**
packages/create-vite/**
ArnaudBarre marked this conversation as resolved.
Show resolved Hide resolved

ArnaudBarre marked this conversation as resolved.
Show resolved Hide resolved
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4

Expand Down Expand Up @@ -101,3 +133,43 @@ jobs:

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

lint:
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Lint: node-18, ubuntu-latest"
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

- 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=""