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 5eaa17c commit c7975ee
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 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"
33 changes: 33 additions & 0 deletions .github/workflows/tests-components.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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: Build components
run: pnpm run build:components
- name: Lint components
run: pnpm run lint:components
- name: Run tests
run: pnpm test:components
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
"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",
"lint:components": "cd libs/components && pnpm run lint",
"format:components": "cd libs/components && pnpm run format",
"lintPython": "cd backend && poetry run mypy chainlit/",
"formatPython": "black `git ls-files | grep '.py$'` && isort --profile=black .",
"buildUi": "cd libs/components && pnpm run build && cd ../../frontend && pnpm run build",
"build:components": "cd libs/components && pnpm build",
"build": "pnpm run buildUi && (mkdir -p backend/chainlit/frontend && cp -R frontend/dist backend/chainlit/frontend) && (cd backend && poetry build)"
}
}

0 comments on commit c7975ee

Please sign in to comment.