From 5ce3edae8ec30452ce6e80d50a2f5d7630d2f5b1 Mon Sep 17 00:00:00 2001 From: Everaldo Date: Fri, 16 Aug 2024 14:01:55 -0700 Subject: [PATCH] Refactor to python. --- .github/workflows/scheduled_tests.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/scheduled_tests.yml b/.github/workflows/scheduled_tests.yml index c009ebdd..e73b95af 100644 --- a/.github/workflows/scheduled_tests.yml +++ b/.github/workflows/scheduled_tests.yml @@ -55,14 +55,18 @@ jobs: import sys - # # Set up Python environment - # def setup_environment(): - # # os.environ["AWS_ACCESS_KEY_ID"] = "AWS_ACCESS_KEY_ID" - # # os.environ["AWS_SECRET_ACCESS_KEY"] = "AWS_SECRET_ACCESS_KEY" - # # os.environ["AWS_DEFAULT_REGION"] = "AWS_REGION" - # # os.environ["SLACK_WEBHOOK_URL"] = "SLACK_WEBHOOK_URL" - # # os.environ["SLACK_CHANNEL"] = "SLACK_CHANNEL" - + # Set up Python environment + def setup_environment(): + # os.environ["AWS_ACCESS_KEY_ID"] = "AWS_ACCESS_KEY_ID" + # os.environ["AWS_SECRET_ACCESS_KEY"] = "AWS_SECRET_ACCESS_KEY" + # os.environ["AWS_DEFAULT_REGION"] = "AWS_REGION" + # os.environ["SLACK_WEBHOOK_URL"] = "SLACK_WEBHOOK_URL" + # os.environ["SLACK_CHANNEL"] = "SLACK_CHANNEL" + subprocess.run(["python", "-m", "venv", ".venv_test"], check=True) + subprocess.run([".venv_test/bin/pip", "install", "--upgrade", "pip"], check=True) + subprocess.run([".venv_test/bin/pip", "install", "-r", "requirements_web.txt"], check=True) + subprocess.run([".venv_test/bin/pip", "install", "pytest", "boto3", "jq"], check=True) + # Determine repository name and set build version file name def determine_repo_name(): repo_name = subprocess.run(["basename", "$(git rev-parse --show-toplevel)"], capture_output=True, text=True, shell=True).stdout.strip() @@ -124,7 +128,8 @@ jobs: print(" └─ Not stored!") def main(): - # setup_environment() + print("### Setup environment...") + setup_environment() print("### Determine repository name and set build version file name...") _, slack_username, build_version_file = determine_repo_name()