Skip to content

Commit

Permalink
Update soaking.yml (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyTrivail authored Nov 16, 2020
1 parent d9b3d6b commit 68101e0
Showing 1 changed file with 198 additions and 6 deletions.
204 changes: 198 additions & 6 deletions .github/workflows/soaking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,107 @@ jobs:
if [[ -f testing-framework/terraform/testcases/${{ matrix.testcase }}/parameters.tfvars ]] ; then opts="-var-file=../testcases/${{ matrix.testcase }}/parameters.tfvars" ; else opts="" ; fi
cd testing-framework/terraform/soaking && terraform init && terraform apply -auto-approve $opts -var="aoc_version=${{ needs.get-testing-version.outputs.testing_version }}" -var="testcase=../testcases/${{ matrix.testcase }}" -var="testing_ami=${{ matrix.testing_ami }}"
- name: Upload Artifacts
if: success()
uses: actions/upload-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Destroy resources
if: ${{ always() }}
run: |
cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve
if: success() != true
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

soaking-pulling-1:
runs-on: ubuntu-latest
needs: [run-soaking-test]
strategy:
matrix: ${{ fromJson(needs.get-soaking-test-cases.outputs.soaking_matrix) }}

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-west-2

- name: Set up terraform
uses: hashicorp/setup-terraform@v1

- name: Download Terraform context
uses: actions/download-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Soaking Test pulling
run: cd testing-framework/terraform/soaking && docker-compose -f validator_docker_compose.yml up --abort-on-container-exit

- name: Destroy resources
if: success() != true
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

soaking-pulling-2:
runs-on: ubuntu-test
needs: [soaking-pulling-1]
strategy:
matrix: ${{ fromJson(needs.get-soaking-test-cases.outputs.soaking_matrix) }}

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-west-2

- name: Set up terraform
uses: hashicorp/setup-terraform@v1

- name: Download Terraform context
uses: actions/download-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Soaking Test pulling
run: cd testing-framework/terraform/soaking && docker-compose -f validator_docker_compose.yml up --abort-on-container-exit

- name: Destroy resources
if: success() != true
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

soaking-pulling-3:
runs-on: ubuntu-test
needs: [soaking-pulling-2]
strategy:
matrix: ${{ fromJson(needs.get-soaking-test-cases.outputs.soaking_matrix) }}

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-west-2

- name: Set up terraform
uses: hashicorp/setup-terraform@v1

- name: Download Terraform context
uses: actions/download-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Soaking Test pulling
run: cd testing-framework/terraform/soaking && docker-compose -f validator_docker_compose.yml up --abort-on-container-exit

- name: Destroy resources
if: always()
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

run-negative-soaking-test:
runs-on: ubuntu-latest
needs: [get-negative-soaking-test-cases, get-testing-version]
Expand Down Expand Up @@ -163,8 +259,104 @@ jobs:
run: |
if [[ -f testing-framework/terraform/testcases/${{ matrix.testcase }}/parameters.tfvars ]] ; then opts="-var-file=../testcases/${{ matrix.testcase }}/parameters.tfvars" ; else opts="" ; fi
cd testing-framework/terraform/soaking && terraform init && terraform apply -auto-approve $opts -var="negative_soaking=true" -var="aoc_version=${{ needs.get-testing-version.outputs.testing_version }}" -var="testcase=../testcases/${{ matrix.testcase }}" -var="testing_ami=${{ matrix.testing_ami }}"
- name: Upload Artifacts
if: success()
uses: actions/upload-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Destroy resources
if: success() != true
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

negative-soaking-pulling-1:
runs-on: ubuntu-latest
needs: [run-negative-soaking-test]
strategy:
matrix: ${{ fromJson(needs.get-negative-soaking-test-cases.outputs.soaking_matrix) }}

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-west-2

- name: Set up terraform
uses: hashicorp/setup-terraform@v1

- name: Download Terraform context
uses: actions/download-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Soaking Test pulling
run: cd testing-framework/terraform/soaking && docker-compose -f validator_docker_compose.yml up --abort-on-container-exit

- name: Destroy resources
if: ${{ always() }}
run: |
cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve
if: success() != true
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

negative-soaking-pulling-2:
runs-on: ubuntu-latest
needs: [negative-soaking-pulling-1]
strategy:
matrix: ${{ fromJson(needs.get-negative-soaking-test-cases.outputs.soaking_matrix) }}

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-west-2

- name: Set up terraform
uses: hashicorp/setup-terraform@v1

- name: Download Terraform context
uses: actions/download-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Soaking Test pulling
run: cd testing-framework/terraform/soaking && docker-compose -f validator_docker_compose.yml up --abort-on-container-exit

- name: Destroy resources
if: success() != true
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

negative-soaking-pulling-3:
runs-on: ubuntu-latest
needs: [negative-soaking-pulling-2]
strategy:
matrix: ${{ fromJson(needs.get-negative-soaking-test-cases.outputs.soaking_matrix) }}

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.INTEG_TEST_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }}
aws-region: us-west-2

- name: Set up terraform
uses: hashicorp/setup-terraform@v1

- name: Download Terraform context
uses: actions/download-artifact@v2
with:
name: "terraform-context-${{ matrix.testcase }}-${{ matrix.testing_ami }}"
path: "testing-framework/"

- name: Soaking Test pulling
run: cd testing-framework/terraform/soaking && docker-compose -f validator_docker_compose.yml up --abort-on-container-exit

- name: Destroy resources
if: always()
run: cd testing-framework/terraform/soaking && terraform init && terraform destroy -auto-approve

0 comments on commit 68101e0

Please sign in to comment.