-
Notifications
You must be signed in to change notification settings - Fork 39
139 lines (115 loc) · 3.76 KB
/
ci-workflow.yml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
actions: read
contents: read
security-events: write
jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript
- uses: azure/login@v2
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm ci
- name: Run Tests
env:
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}
run: npm test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
run-tests-edge:
name: Run Tests (Edge)
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Installing Az CLI Edge build
run: |
cd ../..
CWD="$(pwd)"
python3 -m venv oidc-venv
. oidc-venv/bin/activate
echo "***********activated virual environment**********"
python3 -m pip install --upgrade pip
echo "***************started installing cli edge build******************"
pip3 install -q --upgrade --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --no-cache-dir --upgrade-strategy=eager
echo "***************installed cli Edge build*******************"
echo "$CWD/oidc-venv/bin" >> $GITHUB_PATH
az --version
- uses: azure/login@v2
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- run: npm ci
- name: Run Tests
env:
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}
run: npm test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
execute-action:
name: Execute Action
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
- uses: azure/login@v2
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}
- name: Run Action
id: deploy
uses: ./
with:
scope: resourcegroup
subscriptionId: ${{ secrets.SUBSCRIPTION_ID }}
resourceGroupName: arm-deploy-e2e
parameters: test/bicep/inputs-outputs.bicepparam
deploymentName: e2e-test-${{ matrix.os }}
maskedOutputs: |
myServerIP
- name: Print Result
run: |
echo "StringOutput=${{ steps.deploy.outputs.stringOutput }}"
echo "intOutput=${{ steps.deploy.outputs.intOutput }}"
echo "objectOutput=${{ steps.deploy.outputs.objectOutput }}"
echo "myServerIP=${{ steps.deploy.outputs.myServerIP }}"
# myServerIP is register as secret, it can still be accessed, just won't print in raw form.
echo "myServerIPEncoded=$(echo ${{ steps.deploy.outputs.myServerIP }} | base64)"