|
26 | 26 |
|
27 | 27 |
|
28 | 28 | jobs:
|
29 |
| - run-it-tests-job: |
| 29 | + run-terraform-deployment: |
| 30 | + name: Run Terraform Deployment |
| 31 | + runs-on: ${{ inputs.runner-os || 'ubuntu-latest' }} |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Set up Python 3.11 |
| 37 | + id: setup-python |
| 38 | + uses: actions/setup-python@v2 |
| 39 | + with: |
| 40 | + python-version: 3.11 |
| 41 | + |
| 42 | + - name: Install Terraform |
| 43 | + uses: hashicorp/setup-terraform@v3 |
| 44 | + |
| 45 | + - name: Install Terraform Local |
| 46 | + run: | |
| 47 | + pip install --upgrade terraform-local |
| 48 | +
|
| 49 | + - name: Set up Project |
| 50 | + run: | |
| 51 | + pip install -r requirements-dev.txt |
| 52 | +
|
| 53 | + - name: Start LocalStack |
| 54 | + uses: LocalStack/[email protected] |
| 55 | + with: |
| 56 | + image-tag: 'latest' |
| 57 | + use-pro: 'true' |
| 58 | + configuration: LS_LOG=trace |
| 59 | + install-awslocal: 'true' |
| 60 | + env: |
| 61 | + LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} |
| 62 | + |
| 63 | + - name: Build lambdas |
| 64 | + run: | |
| 65 | + bin/build_lambdas.sh |
| 66 | +
|
| 67 | + - name: Deploy infrastructure |
| 68 | + run: | |
| 69 | + cd deployment/terraform |
| 70 | + tflocal init |
| 71 | + tflocal apply --auto-approve |
| 72 | +
|
| 73 | + - name: Show localstack logs |
| 74 | + if: always() |
| 75 | + run: | |
| 76 | + localstack logs |
| 77 | +
|
| 78 | + - name: Send a Slack notification |
| 79 | + if: failure() || github.event_name != 'pull_request' |
| 80 | + uses: ravsamhq/notify-slack-action@v2 |
| 81 | + with: |
| 82 | + status: ${{ job.status }} |
| 83 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + notification_title: "{workflow} has {status_message}" |
| 85 | + message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" |
| 86 | + footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>" |
| 87 | + notify_when: "failure" |
| 88 | + env: |
| 89 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 90 | + |
| 91 | + - name: Generate a Diagnostic Report |
| 92 | + if: failure() |
| 93 | + run: | |
| 94 | + curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz |
| 95 | +
|
| 96 | + - name: Upload the Diagnostic Report |
| 97 | + if: failure() |
| 98 | + uses: actions/upload-artifact@v4 |
| 99 | + with: |
| 100 | + name: diagnose.json.gz |
| 101 | + path: ./diagnose.json.gz |
| 102 | + |
| 103 | + run-integration-tests-job: |
| 104 | + name: Run Integration Tests |
30 | 105 | runs-on: ${{ inputs.runner-os || 'ubuntu-latest' }}
|
31 | 106 | steps:
|
32 | 107 | - name: Checkout
|
|
0 commit comments