-
Notifications
You must be signed in to change notification settings - Fork 22
65 lines (55 loc) · 1.96 KB
/
azure_integration_test.yaml
File metadata and controls
65 lines (55 loc) · 1.96 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
name: Azure Integration Tests
on:
push:
branches:
- main # Trigger the workflow when code is pushed to the main branch
pull_request:
branches:
- main # Trigger the workflow when the PR targets the main branch
workflow_dispatch: # Allows manual triggering of the workflow
env:
GOOS: linux
GO111MODULE: on
jobs:
test-azure:
name: Run Azure Integration Tests
runs-on: ubuntu-24.04
env:
AZURE_APP_ID: ${{ secrets.AZURE_APP_ID }}
AZURE_PASSWORD: ${{ secrets.AZURE_PASSWORD }}
AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
steps:
- name: Check if environment variables are set # Validate secrets are passed
run: |
if [[ -z "$AZURE_APP_ID" ]]; then
echo "AZURE_APP_ID is not set. Please check if secrets.AZURE_APP_ID is in the repository."
exit 1
fi
if [[ -z "$AZURE_PASSWORD" ]]; then
echo "AZURE_PASSWORD is not set. Please check if secrets.AZURE_PASSWORD is in the repository."
exit 1
fi
if [[ -z "$AZURE_TENANT" ]]; then
echo "AZURE_TENANT is not set. Please check if secrets.AZURE_TENANT is in the repository."
exit 1
fi
- name: Checkout GitHub Repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az --version
- name: Install Golang
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Azure CLI Login Using Service Principal
run: az login --service-principal --username "$AZURE_APP_ID" --password "$AZURE_PASSWORD" --tenant "$AZURE_TENANT"
- name: Run Azure-related integration test
run: go test -v ./pkg/driver/deployment/azure_functions_test.go