-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.43 KB
/
test.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
name: Run tests
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Set environment variable from secret
- name: Set OPENAI_API_KEY environment variable
env:
OPENAI_API_SECRET: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }}
GCP_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
run: |
echo $GCP_CREDENTIALS_JSON > /tmp/credentials.json
echo "OPENAI_API_KEY=$OPENAI_API_SECRET" >> $GITHUB_ENV
echo "GOOGLE_APPLICATION_CREDENTIALS=/tmp/credentials.json" >> $GITHUB_ENV
echo "OPENAI_API_VERSION=$OPENAI_API_VERSION" >> $GITHUB_ENV
echo "AZURE_OPENAI_API_KEY=$AZURE_OPENAI_API_KEY" >> $GITHUB_ENV
echo "AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT" >> $GITHUB_ENV
# Step 2: Checkout repo recursively
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Install uv
uses: astral-sh/setup-uv@v5
# Step 4: Run uv commands
- name: Run uv commands
run: |
uv sync --all-extras
uv run pytest tests/test_gcloud.py -s