Skip to content

Commit 367c4c8

Browse files
committed
chore: configure ci/cd
1 parent 9fe5fbb commit 367c4c8

File tree

5 files changed

+43
-7
lines changed

5 files changed

+43
-7
lines changed

.github/actions/tests/python/action.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ inputs:
1111
description: "The version of Python to use, such as 3.11.0"
1212
required: true
1313
type: string
14+
openai-api-organization:
15+
description: "The OpenAI API organization"
16+
required: true
17+
type: string
18+
openai-api-key:
19+
description: "The OpenAI API key"
20+
required: true
21+
type: string
22+
pinecone-api-key:
23+
description: "The Pinecone API key"
24+
required: true
25+
type: string
26+
pinecone-environment:
27+
description: "The Pinecone environment"
28+
required: true
29+
type: string
30+
pinecone-index-name:
31+
description: "The Pinecone index name"
32+
required: true
33+
type: string
1434

1535
env:
1636
REQUIREMENTS_PATH: "api/terraform/python/layer_genai/requirements.txt"
@@ -60,14 +80,16 @@ runs:
6080
echo "OPENAI_API_KEY=${{ env.OPENAI_API_KEY }}" >> ./.env
6181
echo "PINECONE_API_KEY=${{ env.PINECONE_API_KEY }}" >> ./.env
6282
echo "PINECONE_ENVIRONMENT=${{ env.PINECONE_ENVIRONMENT }}" >> ./.env
83+
echo "PINECONE_INDEX_NAME=${{ env.PINECONE_INDEX_NAME }}" >> ./.env
6384
env:
64-
OPENAI_API_ORGANIZATION: "SET-ME-PLEASE"
65-
OPENAI_API_KEY: "SET-ME-PLEASE"
66-
PINECONE_API_KEY: "SET-ME-PLEASE"
67-
PINECONE_ENVIRONMENT: "SET-ME-PLEASE"
85+
OPENAI_API_ORGANIZATION: ${{ inputs.openai-api-organization }}
86+
OPENAI_API_KEY: ${{ inputs.openai-api-key }}
87+
PINECONE_API_KEY: ${{ inputs.pinecone-api-key }}
88+
PINECONE_ENVIRONMENT: ${{ inputs.pinecone-environment }}
89+
PINECONE_INDEX_NAME: ${{ inputs.pinecone-index-name }}
6890

6991
- name: Run Tests
7092
shell: bash
7193
run: |
72-
cd ./grader
73-
pytest -v -s tests/
94+
cd models && pytest -v -s tests/
95+
python -m setup_test

.github/workflows/runTests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ jobs:
2626
openai-api-key: "${{ secrets.OPENAI_API_KEY }}"
2727
pinecone-api-key: "${{ secrets.PINECONE_API_KEY }}"
2828
pinecone-environment: "${{ secrets.PINECONE_ENVIRONMENT }}"
29+
pinecone-index-name: "${{ secrets.PINECONE_INDEX_NAME }}"

.prettierignore

Whitespace-only changes.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,16 @@ cd automatic-models
6161
make init
6262
make activate
6363
```
64+
65+
### Github Actions
66+
67+
Actions requires the following secrets:
68+
69+
```console
70+
PAT: {{ secrets.PAT }} # a GitHub Personal Access Token
71+
OPENAI_API_ORGANIZATION: {{ secrets.OPENAI_API_ORGANIZATION }}
72+
OPENAI_API_KEY: {{ secrets.OPENAI_API_KEY }}
73+
PINECONE_API_KEY: {{ secrets.PINECONE_API_KEY }}
74+
PINECONE_ENVIRONMENT: {{ secrets.PINECONE_ENVIRONMENT }}
75+
PINECONE_INDEX_NAME: {{ secrets.PINECONE_INDEX_NAME }}
76+
```

models/tests/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# flake8: noqa: F401
33
# pylint: disable=too-few-public-methods
44
"""
5-
Test integrity of automated grader class methods.
5+
Test integrity of base class.
66
"""
77
import pytest # pylint: disable=unused-import
88

0 commit comments

Comments
 (0)