-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.14 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
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 }}
GCP_CREDENTIALS_JSON: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
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
# Step 2: Checkout repo recursively
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Poetry
uses: snok/install-poetry@v1
# Step 4: Run poetry command
- name: Run poetry command
run: |
poetry install
poetry run pytest tests/test_gcloud.py -s