forked from livekit/agents-js
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 2.6 KB
/
Copy pathtest.yml
File metadata and controls
70 lines (68 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# SPDX-FileCopyrightText: 2024 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0
name: Test
on:
push:
branches: [next, main, 0.x]
pull_request:
branches: [next, main, 0.x]
jobs:
build:
name: Test
# Don't run tests for PRs on forks
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: pnpm/action-setup@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Check which tests to run
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
agents-or-tests:
- 'agents/**'
- 'plugins/test/**'
plugins:
- 'plugins/**'
- name: Test agents
if: steps.filter.outputs.agents-or-tests == 'true' || github.event_name != 'pull_request'
run: pnpm test agents
# TODO (AJS-83) Re-enable once plugins are refactored with abort controllers
# - name: Test all plugins
# if: steps.filter.outputs.agents-or-tests == 'true' || github.event_name != 'pull_request'
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# ELEVEN_API_KEY: ${{ secrets.ELEVEN_API_KEY }}
# DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
# CARTESIA_API_KEY: ${{ secrets.CARTESIA_API_KEY }}
# NEUPHONIC_API_KEY: ${{ secrets.NEUPHONIC_API_KEY }}
# RESEMBLE_API_KEY: ${{ secrets.RESEMBLE_API_KEY }}
# run: pnpm test plugins
# - name: Test specific plugins
# if: steps.filter.outputs.agents-or-tests == 'false' && steps.filter.outputs.plugins == 'true' && github.event_name == 'pull_request'
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# ELEVEN_API_KEY: ${{ secrets.ELEVEN_API_KEY }}
# DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
# CARTESIA_API_KEY: ${{ secrets.CARTESIA_API_KEY }}
# NEUPHONIC_API_KEY: ${{ secrets.NEUPHONIC_API_KEY }}
# RESEMBLE_API_KEY: ${{ secrets.RESEMBLE_API_KEY }}
# run: |
# plugins=$(git diff-tree --name-only --no-commit-id -r ${{ github.sha }} | grep '^plugins.*\.ts$' | cut -d/ -f2 | sort -u | tr '\n' ' ')
# read -ra plugins <<< "$plugins"
# for plugin in "${plugins[@]}"; do
# pnpm test $plugin
# done