|
14 | 14 | - dev |
15 | 15 | - uat |
16 | 16 | - prod |
| 17 | + allure: |
| 18 | + description: 'generate the allure report' |
| 19 | + required: false |
| 20 | + type: boolean |
| 21 | + default: false |
17 | 22 | canary: |
18 | 23 | description: 'run the tests on canary version' |
19 | 24 | required: false |
@@ -47,22 +52,62 @@ jobs: |
47 | 52 | # from https://github.com/Azure/login/commits/master |
48 | 53 | uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 |
49 | 54 | with: |
50 | | - client-id: ${{ secrets.CD_CLIENT_ID }} |
| 55 | + client-id: ${{ secrets.CI_CLIENT_ID }} |
51 | 56 | tenant-id: ${{ secrets.TENANT_ID }} |
52 | 57 | subscription-id: ${{ secrets.SUBSCRIPTION_ID }} |
53 | 58 |
|
| 59 | + - name: Delete old reports |
| 60 | + if: ${{ inputs.allure }} |
| 61 | + uses: azure/CLI@4db43908b9df2e7ac93c8275a8f9a448c59338dd # v1 |
| 62 | + env: |
| 63 | + STORAGE_NAME: ${{ vars.INTEGRATION_TEST_STORAGE_ACCOUNT_NAME }} |
| 64 | + STORAGE_FOLDER: ${{ vars.INTEGRATION_TEST_REPORTS_FOLDER }} |
| 65 | + with: |
| 66 | + inlineScript: | |
| 67 | + az storage blob delete-batch \ |
| 68 | + --source "${{ env.STORAGE_FOLDER }}" \ |
| 69 | + --account-name "${{ env.STORAGE_NAME }}" \ |
| 70 | + --subscription "${{ secrets.SUBSCRIPTION_ID }}" \ |
| 71 | + --auth-mode login |
| 72 | +
|
54 | 73 | - name: Run Integration Tests |
55 | 74 | shell: bash |
56 | 75 | run: | |
57 | 76 | export SUBKEY=${{ secrets.SUBKEY }} |
58 | 77 | export CANARY=${{ inputs.canary }} |
| 78 | + export TYPE=$([ ${{ inputs.allure }} = true ] && echo "allure" || echo "old") |
59 | 79 | export CUCUMBER_PUBLISH_TOKEN=${{ secrets.CUCUMBER_PUBLISH_TOKEN }} |
60 | 80 | export ISSUER_RANGE_TABLE=${{ vars.ISSUER_RANGE_TABLE }} |
61 | 81 | export AFM_SA_CONNECTION_STRING='${{ secrets.AFM_SA_CONNECTION_STRING }}' |
62 | 82 |
|
63 | 83 | cd ./integration-test |
64 | 84 | chmod +x ./run_integration_test.sh |
65 | | - ./run_integration_test.sh ${{( github.event.inputs == null && 'dev') || inputs.environment }} |
| 85 | + ./run_integration_test.sh ${{( github.event.inputs == null && 'dev') || inputs.environment }} $TYPE |
| 86 | +
|
| 87 | + - name: Generate allure report |
| 88 | + if: ${{ inputs.allure }} |
| 89 | + shell: bash |
| 90 | + run: | |
| 91 | + cd ./integration-test |
| 92 | + docker build -t afm-calculator-allure-report-generator . |
| 93 | + docker run \ |
| 94 | + -v ./allure:/app/allure afm-calculator-allure-report-generator |
| 95 | +
|
| 96 | + - name: Upload reports |
| 97 | + if: ${{ inputs.allure }} |
| 98 | + uses: azure/CLI@4db43908b9df2e7ac93c8275a8f9a448c59338dd # v1 |
| 99 | + env: |
| 100 | + STORAGE_NAME: ${{ vars.INTEGRATION_TEST_STORAGE_ACCOUNT_NAME }} |
| 101 | + STORAGE_FOLDER: ${{ vars.INTEGRATION_TEST_REPORTS_FOLDER }} |
| 102 | + with: |
| 103 | + inlineScript: | |
| 104 | + az storage blob upload-batch \ |
| 105 | + --destination '${{ env.STORAGE_FOLDER }}/reports' \ |
| 106 | + --source ./integration-test/allure/reports \ |
| 107 | + --account-name ${{ env.STORAGE_NAME }} \ |
| 108 | + --subscription ${{ secrets.SUBSCRIPTION_ID }} \ |
| 109 | + --overwrite true \ |
| 110 | + --auth-mode login |
66 | 111 |
|
67 | 112 | notify: |
68 | 113 | needs: [ integration_test ] |
|
0 commit comments