[DRAFT POC] feat: helm agent integration tests POC #25
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: Helm Charts Agent - Integration Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
#Special permissions required for OIDC authentication | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
env: | |
TF_VAR_OBSERVE_URL: ${{secrets.OBSERVE_URL}} | |
TF_VAR_OBSERVE_TOKEN: ${{secrets.OBSERVE_TOKEN}} | |
TF_VAR_cluster_role_arn: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
jobs: | |
helm-charts-agent-integration-tests: | |
name: helm-charts-agent-integration-tests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: integration/modules/deploy_helm #Terrafrom commands and tests are ran from integration directory | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- run: git branch && df -h | |
- name: Configure AWS Credentials ## Terraform provider automatically uses these creds | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-session-name: ${{ github.sha }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
#- run: pip install -r scripts/requirements.txt | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.8.5 | |
- name: Terraform Init | |
id: init | |
run: terraform init | |
- name: Terraform Validate | |
id: validate | |
run: terraform validate -no-color | |
- name: Terraform plan | |
id: plan | |
run: | | |
terraform plan | |
- name: Terraform apply | |
id: apply | |
run: | | |
terraform apply --auto-approve | |
- name: Terraform destroy | |
id: destroy | |
if: always() | |
run: | | |
sleep 180 # wait 3 mins and destroy, still need to cleanup namespace if helm chart fails | |
terraform destroy --auto-approve |