Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 57 additions & 39 deletions .github/workflows/jest.yml → .github/workflows/vitest.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
name: Run test and report code coverage on /react and /backend.ai-ui
name: Run Vitest on /react, /packages/backend.ai-ui, and /scripts

on:
pull_request:
paths:
- react/src/**
- react/package.json
- react/vitest.config.ts
- packages/backend.ai-ui/src/**
- packages/backend.ai-ui/package.json
- packages/backend.ai-ui/vitest.config.ts
- scripts/**
- src/**
- vitest.config.ts

permissions:
contents: read

defaults:
run:
working-directory: ./react
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
react-changed: ${{ steps.changes.outputs.react }}
backend-ai-ui-changed: ${{ steps.changes.outputs.backend-ai-ui }}
root-changed: ${{ steps.changes.outputs.root }}
steps:
- uses: actions/checkout@v5
- uses: dorny/paths-filter@v3
Expand All @@ -29,17 +32,23 @@ jobs:
react:
- 'react/src/**'
- 'react/package.json'
- 'react/vitest.config.ts'
backend-ai-ui:
- 'packages/backend.ai-ui/src/**'
- 'packages/backend.ai-ui/package.json'
react-coverage:
- 'packages/backend.ai-ui/vitest.config.ts'
root:
- 'scripts/**'
- 'src/**'
- 'vitest.config.ts'

react-vitest:
needs: check-changes
if: needs.check-changes.outputs.react-changed == 'true'
permissions:
checks: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./react
steps:
- uses: actions/checkout@v5
- uses: jwalton/gh-find-current-pr@v1
Expand All @@ -65,38 +74,24 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
working-directory: .
run: pnpm install --merge-git-branch-lockfiles --no-frozen-lockfile
- name: Run ESLint on React
run: pnpm run lint
- name: run relay-compiler
- name: Run relay-compiler
run: pnpm run relay
- name: Clear Jest cache
run: pnpm exec jest --clearCache
- name: Jest report
uses: ArtiomTr/jest-coverage-report-action@v2
with:
skip-step: install
working-directory: ./react
package-manager: pnpm
test-script: pnpm run test
prnumber: ${{ steps.findPr.outputs.number }}
annotations: failed-tests
- name: Run Vitest
run: pnpm run vitest

backend-ai-ui-coverage:
backend-ai-ui-vitest:
needs: check-changes
if: needs.check-changes.outputs.backend-ai-ui-changed == 'true'
permissions:
checks: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/backend.ai-ui
steps:
- uses: actions/checkout@v5
- uses: jwalton/gh-find-current-pr@v1
id: findPr
- uses: pnpm/action-setup@v5
name: Install pnpm
with:
Expand All @@ -118,19 +113,42 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
working-directory: .
run: pnpm install --merge-git-branch-lockfiles --no-frozen-lockfile
- name: Run ESLint on backend.ai-ui
run: pnpm run lint
- name: run relay-compiler
- name: Run relay-compiler
run: cd ../.. && pnpm run relay
- name: Clear Jest cache
run: pnpm exec jest --clearCache
- name: Jest report for backend.ai-ui
uses: ArtiomTr/jest-coverage-report-action@v2
- name: Run Vitest
run: pnpm run vitest

root-vitest:
needs: check-changes
if: needs.check-changes.outputs.root-changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest
run_install: false
- uses: actions/setup-node@v5
with:
skip-step: install
working-directory: ./packages/backend.ai-ui
package-manager: pnpm
test-script: pnpm run test
prnumber: ${{ steps.findPr.outputs.number }}
annotations: failed-tests
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v5
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --merge-git-branch-lockfiles --no-frozen-lockfile
- name: Run Vitest
run: pnpm run vitest
1 change: 0 additions & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,3 @@ patchedDependencies:
'@lobehub/fluent-emoji@2.0.0': react/patches/lobehub__fluent-emoji@2.0.0.patch
'@rc-component/form': react/patches/@rc-component__form.patch
ansi_up@6.0.6: react/patches/ansi_up@6.0.6.patch
react-scripts@5.0.1: react/patches/react-scripts@5.0.1.patch
52 changes: 0 additions & 52 deletions react/babel.config.cjs

This file was deleted.

Loading
Loading