Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 2 additions & 73 deletions .github/workflows/arm-bicep-e2e-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ permissions:
id-token: write
contents: read


jobs:

testarmbicepe2e:
Expand All @@ -28,6 +27,7 @@ jobs:
contents: read
pull-requests: write
checks: write
id-token: write
steps:
- name: ⤵️ Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -65,75 +65,4 @@ jobs:
subscription-id: ${{ secrets.MPF_SUBSCRIPTIONID }}

- name: 🧪 Run ARM Bicep E2E Tests
run: task teste2e:armbicep



- name: 📤 Upload ARM Bicep e2e test results
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ format('{0}-{1}-test-results', matrix.cli, env.CLI_VERSION) }}
path: testresults.xml
if-no-files-found: warn
overwrite: true

- name: 📤 Upload ARM Bicep e2e test coverage results
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ format('{0}-{1}-test-coverage-results', matrix.cli, env.CLI_VERSION) }}
path: |
coverage.html
coverage.json
coverage.out
coverage.txt
coverage.xml
if-no-files-found: warn
overwrite: true

- name: 📢 Publish ARM Bicep e2e test results
if: always()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
with:
name: 📜 Test results (${{ matrix.cli }} ${{ matrix.version }})
reporter: jest-junit
path: testresults.xml
token: ${{ secrets.GITHUB_TOKEN }}

- name: ⚙️ Get ARM Bicep e2e test Coverage summary
if: always()
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
with:
filename: coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "30 60"

- name: 📤 Upload ARM Bicep e2e Coverage summary
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ format('{0}-{1}-test-coverage-summary', matrix.cli, env.CLI_VERSION) }}
path: |
code-coverage-results.md
if-no-files-found: warn
overwrite: true

check-test-matrix:
if: always()
name: 🧪 Check ARM Bicep e2e Tests
needs: test
runs-on: ubuntu-24.04
steps:
- name: ✅ OK
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: 🛑 Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
run: task teste2e:armbicep
68 changes: 68 additions & 0 deletions .github/workflows/terraform-e2e-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
# Terraform Provider testing workflow.
name: 🧪 v2-terraform-e2e

# This GitHub action runs your tests for each pull request.
# Optionally, you can turn it on using a schedule for regular testing.
on:
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:

testterraforme2e:
name: 🧪 Run Terraform e2e Tests (${{ matrix.cli }} ${{ matrix.version }})
runs-on: ubuntu-24.04
env:
MPF_SUBSCRIPTIONID: ${{ secrets.MPF_SUBSCRIPTIONID }}
MPF_TENANTID: ${{ secrets.MPF_TENANTID }}
MPF_SPCLIENTID: ${{ secrets.MPF_SPCLIENTID }}
MPF_SPCLIENTSECRET: ${{ secrets.MPF_SPCLIENTSECRET }}
MPF_SPOBJECTID: ${{ secrets.MPF_SPOBJECTID }}
permissions:
contents: read
pull-requests: write
checks: write
id-token: write
steps:
- name: ⤵️ Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: 🚧 Setup Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
cache: true

- name: 🚧 Setup Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2.0.0
with:
repo-token: ${{ github.token }}

- name: 🔀 Download Go dependencies
run: task deps:download

- name: 🔨 Setup Test tools
run: task test:tools

- name: 🚧 Setup Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_wrapper: false
terraform_version: "1.10.4"

- name: 'Az CLI login - federated'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_OID_CLIENT_ID }}
tenant-id: ${{ secrets.MPF_TENANTID }}
subscription-id: ${{ secrets.MPF_SUBSCRIPTIONID }}

- name: 🧪 Run Terraform E2E Tests
run: task teste2e:terraform
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ tasks:
desc: Run e2e tests for ARM and Bicep
cmds:
- go clean -testcache
- 'gotestsum --format-hivis --format {{.FORMAT}} --junitfile "testresults.xml" -- ./e2eTests -run TestARM TestBicep -p 1 -timeout 30m -ldflags="{{.LDFLAGS}}" -coverprofile="coverage.out" -covermode atomic'
- task: test:getcover
- 'gotestsum --format-hivis --format {{.FORMAT}} --junitfile "testresults.xml" -- ./e2eTests -run TestARM TestBicep -p 1 -v -timeout 30m -ldflags="{{.LDFLAGS}}" -coverprofile="coverage.out" -covermode atomic'
# - task: test:getcover
vars:
FORMAT: '{{if eq .GITHUB_ACTIONS "true"}}github-actions{{else}}pkgname-and-test-fails{{end}}'
LDFLAGS: "-s -w -X main.version=testAcc"
Expand Down