Skip to content

Commit

Permalink
chore: add workflow to trigger autoscaling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc-bq committed Sep 19, 2023
1 parent 6754855 commit 7f31ee2
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/run-autoscaling-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Run Autoscaling Tests

on:
workflow_dispatch:
push:
branches:
- main
- test/autoscaling

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
all-integration-tests:
name: 'Run Autoscaling tests'
runs-on: ubuntu-latest
steps:
- name: 'Clone repository'
uses: actions/checkout@v3
with:
fetch-depth: 50
- name: 'Set up JDK 8'
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 8
- name: 'Configure AWS credentials'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: 'Set up temp AWS credentials'
run: |
creds=($(aws sts get-session-token \
--duration-seconds 21600 \
--query 'Credentials.[AccessKeyId, SecretAccessKey, SessionToken]' \
--output text \
| xargs));
echo "::add-mask::${creds[0]}"
echo "::add-mask::${creds[1]}"
echo "::add-mask::${creds[2]}"
echo "TEMP_AWS_ACCESS_KEY_ID=${creds[0]}" >> $GITHUB_ENV
echo "TEMP_AWS_SECRET_ACCESS_KEY=${creds[1]}" >> $GITHUB_ENV
echo "TEMP_AWS_SESSION_TOKEN=${creds[2]}" >> $GITHUB_ENV
- name: Run integration tests
run: |
./gradlew --no-parallel --no-daemon test-autoscaling-only
env:
AURORA_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
AURORA_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ env.TEMP_AWS_SESSION_TOKEN }}
- name: 'Archive junit results'
if: always()
uses: actions/upload-artifact@v3
with:
name: junit-report
path: ./wrapper/build/test-results
retention-days: 5
- name: 'Archive autoscaling report'
if: always()
uses: actions/upload-artifact@v3
with:
name: autoscaling-report
path: ./wrapper/build/report
retention-days: 5

0 comments on commit 7f31ee2

Please sign in to comment.