-
Notifications
You must be signed in to change notification settings - Fork 317
87 lines (84 loc) · 3.53 KB
/
Copy pathtest.yml
File metadata and controls
87 lines (84 loc) · 3.53 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# SPDX-FileCopyrightText: 2024 LiveKit, Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Tests run for all PRs including community contributions from forks.
# Note: Current tests don't require secrets. If plugin tests are re-enabled,
# we would need to use workflow_run pattern for privileged operations.
name: Test
on:
push:
branches: [next, main, 0.x]
pull_request:
branches: [next, main, 0.x]
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
lfs: true
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Setup node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Cache turbo
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: .turbo
key: turbo-${{ runner.os }}-node20-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}
restore-keys: |
turbo-${{ runner.os }}-node20-${{ hashFiles('pnpm-lock.yaml') }}-
turbo-${{ runner.os }}-node20-
- name: Build
run: pnpm build
- name: Check which tests to run
uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3.0.3
id: filter
with:
filters: |
agents-or-tests:
- 'agents/**'
- 'plugins/test/**'
plugins:
- 'plugins/**'
examples:
- 'examples/**'
- name: Test agents
if: steps.filter.outputs.agents-or-tests == 'true' || github.event_name == 'push'
run: pnpm test agents
# - name: Test examples
# if: (steps.filter.outputs.examples == 'true' || github.event_name == 'push')
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# run: pnpm test:examples
# 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