Skip to content

Commit

Permalink
refactor: should always use our built-in python unit test action
Browse files Browse the repository at this point in the history
  • Loading branch information
lpm0073 committed Dec 18, 2023
1 parent 134780c commit b5b6fb4
Showing 1 changed file with 14 additions and 28 deletions.
42 changes: 14 additions & 28 deletions .github/workflows/testsPython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,29 @@ on:
paths:
- "**.py"

env:
python-version: "3.11"

jobs:
tests:
name: tests
python-unit-tests:
runs-on: ubuntu-latest
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
- name: Checkout code
id: checkout
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "us-east-1"

- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.11"
aws-region: ${{ secrets.AWS_REGION }}

- name: Cache Python dependencies
uses: actions/cache@v3
- name: Run Python tests
uses: ./.github/actions/tests/python
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
- name: terraform/python Unit tests
run: |
make api-test
python-version: "${{ env.python-version}}"
openai-api-organization: "${{ secrets.OPENAI_API_ORGANIZATION }}"
openai-api-key: "${{ secrets.OPENAI_API_KEY }}"
pinecone-api-key: "${{ secrets.PINECONE_API_KEY }}"
pinecone-environment: "${{ secrets.PINECONE_ENVIRONMENT }}"

0 comments on commit b5b6fb4

Please sign in to comment.