Testing Framework #104
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing Framework | |
on: | |
schedule: # schedule the job to run at 12 AM daily | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
# pull_request: ## temporary for debugging development purposes | |
# branches: | |
# - main | |
env: | |
TF_VAR_aws_region: "eu-west-2" | |
TF_VAR_aws_instance_type: "t3.large" | |
TF_VAR_aws_ami_owners: '["125523088429"]' | |
TF_VAR_aws_ami_name: '["Fedora-Cloud-Base-*"]' | |
TF_VAR_aws_volume_size: 100 | |
TF_VAR_aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
TF_VAR_aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
TF_VAR_provision_script: ../main/.github/scripts/provision.sh | |
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# AWS_DEFAULT_REGION: "eu-west-2" | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: false | |
jobs: | |
integration-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
path: main | |
- name: Checkout terraform module | |
id: checkout-module | |
uses: actions/[email protected] | |
with: | |
repository: containers/terraform-test-environment-module | |
path: terraform-test-environment-module | |
ref: 'main' | |
- name: Setup Terraform | |
uses: hashicorp/[email protected] | |
with: | |
terraform_version: "1.7.5" | |
terraform_wrapper: false | |
- name: Init Terraform | |
run: terraform init | |
working-directory: terraform-test-environment-module | |
- name: Spin Test Environment | |
id: up | |
run: terraform apply -auto-approve -lock=false | |
working-directory: terraform-test-environment-module | |
- name: Terraform Output | |
id: terraform-output | |
run: | | |
echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT | |
echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT | |
working-directory: terraform-test-environment-module | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies | |
working-directory: ./main/recipes/natural_language_processing/chatbot | |
run: make install | |
- name: Wait for the user data script to finish | |
run: sleep 240 | |
- name: Run Integration Tests | |
working-directory: ./main/recipes/natural_language_processing/chatbot | |
run: make URL=${{ steps.terraform-output.outputs.url }} integration_tests | |
- name: Destroy Test Environment | |
id: down | |
if: always() | |
run: terraform destroy -auto-approve -lock=false | |
working-directory: terraform-test-environment-module |