AI Unit Tests & Type Check #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AI Unit Tests & Type Check | |
on: | |
push: | |
branches: [master] | |
paths: | |
- 'packages/ai-commands/**' | |
pull_request: | |
branches: [master] | |
paths: | |
- 'packages/ai-commands/**' | |
schedule: | |
- cron: '15 0 * * 1' # Every Monday @ 12:15am UTC (off the hour to avoid heavy load times) | |
# Cancel old builds on new commit for same workflow + branch/PR | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
defaults: | |
run: | |
working-directory: ./packages/ai-commands | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
packages | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9.10.0 | |
run_install: false | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install deps | |
run: pnpm i | |
- name: Type check | |
run: pnpm run typecheck | |
- name: Run tests | |
run: pnpm run test |