integration-azure #394
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-azure | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 12 * * *" | |
| # push: | |
| # branches: | |
| # - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| oci-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| auth-mode: | |
| - node-identity | |
| - workload-identity | |
| fail-fast: false | |
| defaults: | |
| run: | |
| working-directory: ./tests/integration | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup Go | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: 1.25.x | |
| cache-dependency-path: tests/integration/go.sum | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
| - name: Authenticate to Azure | |
| uses: Azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v1.4.6 | |
| with: | |
| creds: '{"clientId":"${{ secrets.ARM_CLIENT_ID }}","clientSecret":"${{ secrets.ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.ARM_TENANT_ID }}"}' | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 | |
| - name: Set dynamic variables in .env | |
| run: | | |
| cat > .env <<EOF | |
| export TF_VAR_tags='{"environment"="github", "ci"="true", "repo"="pkg", "createdat"="$(date -u +x%Y-%m-%d_%Hh%Mm%Ss)"}' | |
| EOF | |
| - name: Print .env for dynamic tag value reference | |
| run: cat .env | |
| - name: Build test app | |
| run: make docker-build | |
| - name: Prepare Git SSH secrets | |
| run: | | |
| mkdir -p azure | |
| cat <<EOF > azure/identity | |
| $GIT_SSH_IDENTITY | |
| EOF | |
| cat <<EOF > azure/identity.pub | |
| $GIT_SSH_IDENTITY_PUB | |
| EOF | |
| cat <<EOF > azure/known_hosts | |
| $GIT_SSH_KNOWN_HOSTS | |
| EOF | |
| env: | |
| GIT_SSH_IDENTITY: ${{ secrets.GIT_SSH_IDENTITY }} | |
| GIT_SSH_IDENTITY_PUB: ${{ secrets.GIT_SSH_IDENTITY_PUB }} | |
| GIT_SSH_KNOWN_HOSTS: ${{ secrets.GIT_SSH_KNOWN_HOSTS }} | |
| - name: Run tests | |
| run: . .env && make test-azure | |
| env: | |
| ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | |
| ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | |
| ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | |
| ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | |
| TF_VAR_azuredevops_org: ${{ secrets.TF_VAR_azuredevops_org }} | |
| TF_VAR_azuredevops_pat: ${{ secrets.TF_VAR_azuredevops_pat }} | |
| TF_VAR_azure_location: ${{ vars.TF_VAR_azure_location }} | |
| TF_VAR_enable_wi: ${{ (matrix.auth-mode == 'workload-identity') && 'true' || 'false' }} | |
| - name: Ensure resource cleanup | |
| if: ${{ always() }} | |
| run: . .env && make destroy-azure | |
| env: | |
| ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | |
| ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | |
| ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | |
| ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | |
| TF_VAR_azuredevops_org: ${{ secrets.TF_VAR_azuredevops_org }} | |
| TF_VAR_azuredevops_pat: ${{ secrets.TF_VAR_azuredevops_pat }} | |
| TF_VAR_azure_location: ${{ vars.TF_VAR_azure_location }} | |
| TF_VAR_enable_wi: ${{ (matrix.auth-mode == 'workload-identity') && 'true' || 'false' }} |