Integration Tests #569
This file contains hidden or 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: Integration Tests | |
on: | |
schedule: | |
- cron: '00 06 * * *' | |
workflow_dispatch: | |
inputs: | |
environment: | |
required: true | |
type: choice | |
description: Select the Environment | |
options: | |
- dev | |
- uat | |
canary: | |
description: 'run the tests on canary version' | |
required: false | |
type: boolean | |
default: false | |
permissions: | |
id-token: write | |
contents: read | |
deployments: write | |
jobs: | |
integration_test: | |
name: Test ${{(github.event.inputs == null && 'uat') || inputs.environment }} | |
runs-on: [ self-hosted-job, "${{(github.event.inputs == null && 'uat') || inputs.environment }}" ] | |
environment: ${{(github.event.inputs == null && 'uat') || inputs.environment }} | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707 | |
- name: Login | |
id: login | |
# from https://github.com/Azure/login/commits/master | |
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 | |
with: | |
client-id: ${{ secrets.CLIENT_ID }} | |
tenant-id: ${{ secrets.TENANT_ID }} | |
subscription-id: ${{ secrets.SUBSCRIPTION_ID }} | |
- name: Run Integration Tests | |
shell: bash | |
run: | | |
export CUCUMBER_PUBLISH_TOKEN=${{ secrets.CUCUMBER_PUBLISH_TOKEN }} | |
export RECEIPTS_COSMOS_CONN_STRING='${{ secrets.RECEIPTS_COSMOS_CONN_STRING }}' | |
export BIZEVENTS_COSMOS_CONN_STRING='${{ secrets.BIZEVENTS_COSMOS_CONN_STRING }}' | |
cd ./integration-test | |
chmod +x ./run_integration_test.sh | |
./run_integration_test.sh ${{( github.event.inputs == null && 'uat') || inputs.environment }} | |
notify: | |
needs: [ integration_test ] | |
runs-on: [ self-hosted-job, "${{(github.event.inputs == null && 'uat') || inputs.environment }}" ] | |
name: Notify | |
if: always() | |
steps: | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # v2 | |
with: | |
status: ${{ needs.integration_test.result }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
notify_when: 'failure,skipped' | |
notification_title: "<{run_url}|Scheduled Integration Test> has {status_message} in ${{( github.event.inputs == null && 'uat') || inputs.environment }} env" | |
message_format: '{emoji} <{run_url}|{workflow}> {status_message} in <{repo_url}|{repo}>' | |
footer: 'Linked to <{workflow_url}| workflow file>' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_INTEGRATION_TEST }} |