From 98e74fadcd23d875731bd0f844aa1095e57fe00d Mon Sep 17 00:00:00 2001 From: lpm0073 Date: Fri, 17 Nov 2023 09:52:05 -0600 Subject: [PATCH] chore: add more validations --- .github/actions/tests/pre-commit/action.yml | 34 +++++++++++++++++++++ .github/actions/tests/python/action.yml | 28 +++++++++++++++++ .github/actions/tests/terraform/action.yml | 8 +++++ 3 files changed, 70 insertions(+) diff --git a/.github/actions/tests/pre-commit/action.yml b/.github/actions/tests/pre-commit/action.yml index c15328f9..beef5482 100644 --- a/.github/actions/tests/pre-commit/action.yml +++ b/.github/actions/tests/pre-commit/action.yml @@ -18,11 +18,45 @@ runs: id: checkout uses: actions/checkout@v4 + - name: Check for pre-commit in requirements + run: | + if ! grep -q "pre-commit" ./requirements.txt; then + echo "pre-commit not found in requirements.txt" >&2 + exit 1 + fi + + - name: Check for black in requirements + run: | + if ! grep -q "black" ./requirements.txt; then + echo "black not found in requirements.txt" >&2 + exit 1 + fi + + - name: Check for flake8 in requirements + run: | + if ! grep -q "flake8" ./requirements.txt; then + echo "flake8 not found in requirements.txt" >&2 + exit 1 + fi + + - name: Check for flake8-coding in requirements + run: | + if ! grep -q "flake8-coding" ./requirements.txt; then + echo "flake8-coding not found in requirements.txt" >&2 + exit 1 + fi + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ inputs.python-version }} + - name: Install dependencies + shell: bash + run: | + python -m pip install --upgrade pip + pip install -r ./requirements.txt + # see: https://pre-commit.ci/lite.html - name: pre-commit ci id: pre-commit-ci diff --git a/.github/actions/tests/python/action.yml b/.github/actions/tests/python/action.yml index 85a073c6..b4500e03 100644 --- a/.github/actions/tests/python/action.yml +++ b/.github/actions/tests/python/action.yml @@ -52,6 +52,34 @@ runs: exit 1 fi + - name: Check for openai in requirements + run: | + if ! grep -q "openai" ./requirements.txt; then + echo "openai not found in requirements.txt" >&2 + exit 1 + fi + + - name: Check for langchain in requirements + run: | + if ! grep -q "langchain" ./requirements.txt; then + echo "langchain not found in requirements.txt" >&2 + exit 1 + fi + + - name: Check for langchain-experimental in requirements + run: | + if ! grep -q "langchain-experimental" ./requirements.txt; then + echo "langchain-experimental not found in requirements.txt" >&2 + exit 1 + fi + + - name: Check for pinecone-client in requirements + run: | + if ! grep -q "pinecone-client" ./requirements.txt; then + echo "pinecone-client not found in requirements.txt" >&2 + exit 1 + fi + - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/actions/tests/terraform/action.yml b/.github/actions/tests/terraform/action.yml index 1b02a99b..19ea6314 100644 --- a/.github/actions/tests/terraform/action.yml +++ b/.github/actions/tests/terraform/action.yml @@ -37,6 +37,14 @@ runs: exit 1 fi + - name: Verify Terraform is installed + run: | + if ! command -v terraform &> /dev/null + then + echo "Terraform could not be found" + exit 1 + fi + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: