π§ͺ E2E Tests #549
Workflow file for this run
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
| # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json | |
| --- | |
| name: π§ͺ E2E Tests | |
| # This GitHub action runs your tests before merging a pull request via merge groups | |
| # Merge Group Discussions: https://github.com/orgs/community/discussions/51120 | |
| on: | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: 0 21 * * * | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| jobs: | |
| e2e-tests: | |
| if: github.event_name != 'pull_request' | |
| name: π§ͺ E2E Tests | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, windows-2025] | |
| type: [arm, bicep, terraform] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: π©Ί Debug | |
| uses: raven-actions/debug@9dbdeb7eea607a7d73411895c65987e71d59a466 # v1.2.0 | |
| - name: β€΅οΈ Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: π§Ή Clean Terraform sample artifacts | |
| if: matrix.type == 'terraform' | |
| run: git clean -ffdx samples/terraform | |
| - name: π§ Setup Go | |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: π§ Setup Task | |
| uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0 | |
| - name: π Download Go dependencies | |
| run: task deps:download | |
| - name: π¨ Setup Test tools | |
| run: task go:tools:test | |
| - name: π¦ Install Bicep | |
| if: matrix.type == 'bicep' | |
| run: task az:install:bicep | |
| - name: π¦ Install Terraform | |
| if: matrix.type == 'terraform' | |
| run: task tf:install:terraform | |
| - name: π Ensure bin path | |
| if: runner.os == 'Linux' | |
| run: | | |
| INSTALL_PATH="$HOME/.local/bin" | |
| echo "$INSTALL_PATH" >> "${GITHUB_PATH}" | |
| export PATH="$INSTALL_PATH:$PATH" | |
| shell: bash | |
| - name: π Ensure bin path | |
| if: runner.os == 'Windows' | |
| run: | | |
| $INSTALL_PATH = "$env:USERPROFILE\.local\bin" | |
| $INSTALL_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| $env:PATH = "$INSTALL_PATH;$env:PATH" | |
| $INSTALL_PATH = "$env:LOCALAPPDATA\Microsoft\WinGet\Links" | |
| $INSTALL_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| $env:PATH = "$INSTALL_PATH;$env:PATH" | |
| $INSTALL_PATH = "$env:LOCALAPPDATA\Microsoft\WindowsApps" | |
| $INSTALL_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| $env:PATH = "$INSTALL_PATH;$env:PATH" | |
| shell: pwsh | |
| - name: π Azure Login | |
| uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 | |
| with: | |
| client-id: ${{ secrets.AZURE_OID_CLIENT_ID }} | |
| tenant-id: ${{ secrets.MPF_TENANTID }} | |
| subscription-id: ${{ secrets.MPF_SUBSCRIPTIONID }} | |
| - name: π§ͺ Run ${{ matrix.type }} E2E Tests | |
| if: runner.os == 'Linux' | |
| run: task teste2e:${{ matrix.type }} | |
| env: | |
| MPF_SUBSCRIPTIONID: ${{ secrets.MPF_SUBSCRIPTIONID }} | |
| MPF_TENANTID: ${{ secrets.MPF_TENANTID }} | |
| MPF_SPCLIENTID: ${{ matrix.type == 'terraform' && secrets[format('MPF_TERRAFORM_{0}_SPCLIENTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || matrix.type == 'arm' && secrets[format('MPF_ARM_{0}_SPCLIENTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || secrets[format('MPF_BICEP_{0}_SPCLIENTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] }} | |
| MPF_SPCLIENTSECRET: ${{ matrix.type == 'terraform' && secrets[format('MPF_TERRAFORM_{0}_SPCLIENTSECRET', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || matrix.type == 'arm' && secrets[format('MPF_ARM_{0}_SPCLIENTSECRET', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || secrets[format('MPF_BICEP_{0}_SPCLIENTSECRET', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] }} | |
| MPF_SPOBJECTID: ${{ matrix.type == 'terraform' && secrets[format('MPF_TERRAFORM_{0}_SPOBJECTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || matrix.type == 'arm' && secrets[format('MPF_ARM_{0}_SPOBJECTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || secrets[format('MPF_BICEP_{0}_SPOBJECTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] }} | |
| - name: π§ͺ Run ${{ matrix.type }} CLI Tests | |
| run: task testcli:${{ matrix.type }} | |
| env: | |
| MPF_SUBSCRIPTIONID: ${{ secrets.MPF_SUBSCRIPTIONID }} | |
| MPF_TENANTID: ${{ secrets.MPF_TENANTID }} | |
| MPF_SPCLIENTID: ${{ matrix.type == 'terraform' && secrets[format('MPF_TERRAFORM_{0}_SPCLIENTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || matrix.type == 'arm' && secrets[format('MPF_ARM_{0}_SPCLIENTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || secrets[format('MPF_BICEP_{0}_SPCLIENTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] }} | |
| MPF_SPCLIENTSECRET: ${{ matrix.type == 'terraform' && secrets[format('MPF_TERRAFORM_{0}_SPCLIENTSECRET', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || matrix.type == 'arm' && secrets[format('MPF_ARM_{0}_SPCLIENTSECRET', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || secrets[format('MPF_BICEP_{0}_SPCLIENTSECRET', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] }} | |
| MPF_SPOBJECTID: ${{ matrix.type == 'terraform' && secrets[format('MPF_TERRAFORM_{0}_SPOBJECTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || matrix.type == 'arm' && secrets[format('MPF_ARM_{0}_SPOBJECTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] || secrets[format('MPF_BICEP_{0}_SPOBJECTID', runner.os == 'Windows' && 'WINDOWS' || 'LINUX')] }} | |
| check-e2e-tests: | |
| if: always() | |
| name: π§ͺ Check E2E Tests | |
| needs: e2e-tests | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| steps: | |
| - name: β OK | |
| if: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }} | |
| run: exit 0 | |
| - name: π Failure | |
| if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: exit 1 |