Skip to content

Commit

Permalink
Merge branch 'beta' into next
Browse files Browse the repository at this point in the history
merge beta
  • Loading branch information
lpm0073 committed Nov 17, 2023
2 parents 53db452 + 8b5b21d commit 90f8dc6
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 184 deletions.
86 changes: 66 additions & 20 deletions .github/workflows/pullRequestController.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,39 @@ jobs:
echo "::set-output name=py_files_changed::$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\.py$' || true)"
echo "::set-output name=requirements_changed::$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '^${{ env.REQUIREMENTS_PATH }}$' || true)"
- name: Run Python Tests
- name: Set up Python
if: steps.file_changes.outputs.py_files_changed != '' || steps.file_changes.outputs.requirements_changed != ''
id: python_tests
uses: ./.github/workflows/testPython.yml
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: No Python changes detected
if: steps.file_changes.outputs.py_files_changed == '' && steps.file_changes.outputs.requirements_changed == ''
run: echo "No Python or requirements.txt changes detected."
- name: Install dependencies
if: steps.file_changes.outputs.py_files_changed != '' || steps.file_changes.outputs.requirements_changed != ''
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
cp -R ./api/terraform/python/layer_genai/openai_utils /opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/
- name: Create .env
if: steps.file_changes.outputs.py_files_changed != '' || steps.file_changes.outputs.requirements_changed != ''
run: |
touch ./.env
echo "OPENAI_API_ORGANIZATION=${OPENAI_API_ORGANIZATION}" >> ./.env
echo "OPENAI_API_KEY=${OPENAI_API_KEY}" >> ./.env
echo "PINECONE_API_KEY=${PINECONE_API_KEY}" >> ./.env
echo "PINECONE_ENVIRONMENT=${PINECONE_ENVIRONMENT}" >> ./.env
- name: Test lambda_openai_v2
if: steps.file_changes.outputs.py_files_changed != '' || steps.file_changes.outputs.requirements_changed != ''
run: |
cd ./api/terraform/python/lambda_openai_v2
pytest -v -s tests/
- name: Test lambda_langchain
if: steps.file_changes.outputs.py_files_changed != '' || steps.file_changes.outputs.requirements_changed != ''
run: |
cd ./api/terraform/python/lambda_langchain
pytest -v -s tests/
terraform_tests:
needs: check_for_pending_release
Expand All @@ -139,14 +164,31 @@ jobs:
run: |
echo "::set-output name=terraform_files_changed::$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\.tf$' || true)"
- name: Run Terraform Tests
- name: Configure AWS credentials
if: steps.file_changes.outputs.terraform_files_changed != ''
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: ${{ secrets.AWS_REGION }}

- name: Terraform Init
if: steps.file_changes.outputs.terraform_files_changed != ''
id: terraform_tests
uses: ./.github/workflows/testTerraform.yml
run: |
cd api/terraform
terraform init
- name: No Terraform changes detected
if: steps.file_changes.outputs.py_files_changed == ''
run: echo "No Terraform changes detected."
- name: Terraform Validate
if: steps.file_changes.outputs.terraform_files_changed != ''
run: |
cd api/terraform
terraform validate
- name: Terraform Format
if: steps.file_changes.outputs.terraform_files_changed != ''
run: |
cd api/terraform
terraform fmt -check
reactjs_tests:
needs: check_for_pending_release
Expand All @@ -164,11 +206,8 @@ jobs:
- name: Run ReactJS Tests
if: steps.file_changes.outputs.reactjs_files_changed != ''
id: reactjs_tests
uses: ./.github/workflows/testReact.yml

- name: No ReactJS changes detected
if: steps.file_changes.outputs.py_files_changed == ''
run: echo "No ReactJS changes detected."
run: |
echo "Test scaffolding for ReactJS"
pre_commit_tests:
needs: check_for_pending_release
Expand All @@ -178,6 +217,13 @@ jobs:
id: checkout
uses: actions/checkout@v4

- name: Run ReactJS Tests
id: precommit_tests
uses: ./.github/workflows/testPreCommitRules.yml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

# see: https://pre-commit.ci/lite.html
- name: pre-commit ci
id: pre-commit-ci
if: always()
uses: pre-commit-ci/[email protected]
25 changes: 0 additions & 25 deletions .github/workflows/testPreCommitRules.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/testPython.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/testReact.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/testTerraform.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ commands = pytest
ignore = D205,D413,D400,D401
max-line-length =120
max-complexity = 10
exclude = api/terraform/python/lambda_openai/venv, api/terraform/python/lambda_openai/lambda_dist_pkg, api/terraform/python/lambda_langchain/lambda_dist_pkg
exclude = api/terraform/python/lambda_openai/venv, api/terraform/python/lambda_openai/lambda_dist_pkg, api/terraform/python/lambda_openai_v2/lambda_dist_pkg, api/terraform/python/lambda_langchain/lambda_dist_pkg
extend-exclude = *__init__.py,*__version__.py,venv,lambda_dist_pkg
select = C101

Expand Down

0 comments on commit 90f8dc6

Please sign in to comment.