-
Notifications
You must be signed in to change notification settings - Fork 92
127 lines (108 loc) · 3.74 KB
/
test-azure-deploy.yml
File metadata and controls
127 lines (108 loc) · 3.74 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Test azure-deploy deployment tests
#
# Runs the deployment test groups for azure-deploy skill.
# Triggered manually.
name: Integration Tests - azure-deploy
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
inputs:
group-name:
description: 'Deploy test group name to run (e.g. static-web-apps-deploy). If empty, all groups will be run.'
required: false
type: string
default: ''
debug:
description: 'Whether to set DEBUG=1 for jest tests'
required: false
type: boolean
default: false
jobs:
test:
name: Run azure-deploy deployment tests
environment: cideploytest
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 }}
defaults:
run:
working-directory: tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install azd
uses: Azure/setup-azd@v2
- name: Log in with Azure (Federated Credentials)
run: |
azd auth login `
--client-id "$Env:AZURE_CLIENT_ID" `
--federated-credential-provider "github" `
--tenant-id "$Env:AZURE_TENANT_ID"
shell: pwsh
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: tests/package-lock.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: npm ci
# COPILOT_CLI_TOKEN must be a fine-grained access token with the Account level Copilot Request permission
# saved to the secrets of the microsoft/GitHub-Copilot-for-Azure repo.
# As a known issue, when the permission of the token doesn't grant sufficient access,
# the agent will hang instead of giving an error.
# If you see the agent hang indefinitely, try refreshing the access token.
# See https://github.com/github/copilot-sdk/issues/343 for more details.
- name: Setup Copilot CLI
id: setup-copilot-cli
uses: mvkaran/setup-copilot-cli@v1
with:
token: ${{ secrets.COPILOT_CLI_TOKEN }}
- name: Integration tests
id: integration-tests
env:
GH_HEAD_SHA: ${{ github.sha }}
DEBUG: ${{ inputs.debug && '1' || '' }}
run: |
if [ -n "${{ inputs.group-name }}" ]; then
TEST_ARGS="--testNamePattern=${{ inputs.group-name }}"
fi
npm run test:integration -- --testPathPattern="azure-deploy" $TEST_ARGS
continue-on-error: true
- name: Generate report
id: generate-report
run: npm run report -- --skill azure-deploy
- name: Show skill report
id: show-skill-report
run: |
SKILL_REPORT=$(find reports -name "*-SKILL-REPORT.md" -type f | head -n 1)
if [ -n "$SKILL_REPORT" ]; then
echo "Found skill report: $SKILL_REPORT"
cat "$SKILL_REPORT" >> "$GITHUB_STEP_SUMMARY"
else
echo "No skill report found"
fi
- name: Export report
uses: actions/upload-artifact@v4
with:
name: azure-deploy-test-reports
path: tests/reports/
retention-days: 30