1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: live
on:
workflow_dispatch:
inputs:
release:
description: Build release
required: false
type: boolean
default: false
clean:
description: Delete resources
required: false
type: boolean
default: false
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
jobs:
test:
runs-on: ubuntu-latest
env:
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install azd
uses: Azure/setup-azd@v2
- name: Install Pester
run: |
Install-Module Pester -RequiredVersion 5.6.1 -Force -Scope CurrentUser
Import-Module Pester -RequiredVersion 5.6.1
shell: pwsh
- name: Cache
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set up toolchain
run: rustup install
- name: Authenticate az (OIDC)
uses: azure/login@v3
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- name: Authenticate azd (OIDC)
run: >
azd auth login
--client-id "${env:AZURE_CLIENT_ID}"
--federated-credential-provider "github"
--tenant-id "${env:AZURE_TENANT_ID}"
shell: pwsh
- name: Provision
run: azd provision --no-prompt
- name: Test
run: |
Import-Module Pester -RequiredVersion 5.6.1
$container = New-PesterContainer -Path './tests/' -Data @{ Release = ('${{ inputs.release }}' -eq 'true') }
$config = New-PesterConfiguration
$config.Run.Container = $container
$config.Run.Exit = $true
$config.Output.Verbosity = 'Detailed'
$config.TestResult.Enabled = $true
$config.TestResult.OutputFormat = 'JUnitXml'
$config.TestResult.OutputPath = './tests/testResults.xml'
Invoke-Pester -Configuration $config
shell: pwsh
- name: Clean
if: ${{ inputs.clean && !cancelled() }}
continue-on-error: true
run: azd down --force --purge --no-prompt
- name: Summarize tests
uses: test-summary/action@v2
if: always()
with:
paths: |
./tests/*.xml