-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.37 KB
/
test-examples.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
name: "🐢 Build and Test Examples"
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches: [main]
paths:
- "examples/**/*"
push:
branches: [main]
paths:
- "examples/**/*"
permissions:
contents: read
checks: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
# Important security check for pull_request_target
if: |
(github.event_name == 'push') ||
(github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == github.repository)
steps:
- name: Checkout 🛬
uses: actions/checkout@v4
with:
# Important: For PR events, explicitly checkout the PR HEAD
ref: ${{ github.event_name == 'pull_request' && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
persist-credentials: false
- name: Setup Node ⚙️
uses: ./.github/actions/setup-node
with:
version: 22.x
npm_token: ${{ secrets.NPM_TOKEN }}
- name: Build 📦
run: pnpm build:examples
- name: Run tests ✅
run: pnpm test:examples
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}