Skip to content

Commit

Permalink
ci: split e2e test to a single file (#1104)
Browse files Browse the repository at this point in the history
only run E2E test when necessary to reduce unused CI check and cost
  • Loading branch information
himself65 authored Dec 30, 2024
1 parent dec088b commit 57b7232
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 19 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/ci.yml → .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
name: CI
name: E2E

on:
push:
branches: [main]
paths:
- 'packages/**'
- 'examples/**'
- 'e2e/**'
- '.github/workflows/e2e.yml'
pull_request:
types: [opened, synchronize]
paths:
- 'packages/**'
- 'examples/**'
- 'e2e/**'
- '.github/workflows/e2e.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test on (Node ${{ matrix.version }})
strategy:
fail-fast: false
matrix:
version: [18.17.0, 20.8.0, 22.7.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm test

build:
runs-on: ubuntu-latest
steps:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test on (Node ${{ matrix.version }})
strategy:
fail-fast: false
matrix:
version: [18.17.0, 20.8.0, 22.7.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- run: pnpm test

0 comments on commit 57b7232

Please sign in to comment.