-
Notifications
You must be signed in to change notification settings - Fork 4.3k
90 lines (86 loc) · 2.73 KB
/
examples_js.yml
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
88
89
90
name: JS Example Tests
on:
workflow_call:
inputs:
working-directory:
required: false
type: string
api_key:
required: false
type: string
base_url:
required: false
type: string
author:
required: false
type: string
commit_message:
required: false
type: string
dont_notify:
required: false
type: boolean
workflow_dispatch:
inputs:
working-directory:
required: false
type: string
api_key:
required: false
type: string
base_url:
required: false
type: string
author:
required: false
type: string
commit_message:
required: false
type: string
jobs:
run-js-tests:
name: Run JS Example Tests
defaults:
run:
working-directory: ${{ inputs.working-directory }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: ["18"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
run: npm install -g pnpm
- name: Install Dependencies
run: |
pnpm install @ai-sdk/openai ai composio-core dotenv zod @langchain/openai @langchain/core langchain
- name: Run Tests
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
JULEP_API_KEY: ${{secrets.JULEP_API_KEY}}
JULEP_API_URL: ${{secrets.JULEP_API_URL}}
LISTENNOTES_API_KEY: ${{secrets.LISTENNOTES_API_KEY}}
COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_RELEASE }}
COMPOSIO_BASE_URL: 'https://backend.composio.dev'
run: |
pnpm exec jest tests/test_examples.test.js
- name: Slack Notification on Failure
if: ${{ failure() && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'release') && !contains(github.event.head_commit.message, 'Release') && !inputs.dont_notify }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TECH_WEBHOOK }}
SLACK_TITLE: "JS Example Tests Failed"
SLACK_MSG_AUTHOR: ${{ inputs.author || github.actor }}
SLACK_MESSAGE: "<@Apoorv> <@kaavee> ${{ inputs.commit_message || github.event.head_commit.message }}"
SLACK_LINK_NAMES: "true"
SLACK_COLOR: "failure"
SLACK_USERNAME: "GitHub Actions Bot"
SLACK_ICON_EMOJI: ":x:"
SLACK_FOOTER: "Failed Example Tests | GitHub Actions"