Skip to content

Commit

Permalink
build: Run @chainlit/components tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alimtunc committed Sep 8, 2023
1 parent 1cf8a2b commit daab29f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:
tests:
uses: ./.github/workflows/tests.yaml
secrets: inherit
tests-components:
uses: ./.github/workflows/tests-components.yaml
secrets: inherit
ci:
runs-on: ubuntu-latest
name: Run CI
needs: [mypy, tests]
needs: [mypy, tests, tests-components]
steps:
- name: "Done"
- name: 'Done'
run: echo "Done"
29 changes: 29 additions & 0 deletions .github/workflows/tests-components.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests @chainlit/components

# on:
# push:
# paths:
# - 'libs/components'

on: [workflow_call]

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.9
- name: Use Node.js 16.15.0
uses: actions/setup-node@v3
with:
node-version: '16.15.0'
cache: 'pnpm'
- name: Install JS dependencies
run: pnpm install --no-frozen-lockfile
- name: Run tests
run: pnpm test:components
3 changes: 2 additions & 1 deletion libs/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"scripts": {
"build": "tsup src/index.ts theme/index.ts hooks/index.ts --dts --format=esm,cjs --clean --dts",
"build:watch": "tsc && vite build --watch",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"test": "vitest run"
},
"dependencies": {
"@emotion/react": "^11.11.1",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "pnpm exec ts-node ./cypress/support/e2e.ts",
"test:components": "cd libs/components && pnpm test",
"prepare": "husky install",
"lintUi": "cd frontend && pnpm run lint",
"formatUi": "cd frontend && pnpm run format",
Expand Down

0 comments on commit daab29f

Please sign in to comment.