-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (73 loc) · 2.65 KB
/
dependabot-pr.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
name: Test on Dependabot Pull Request
on:
pull_request_target
permissions:
id-token: write
contents: read
jobs:
build:
name: Build To Dev Slot
runs-on: ubuntu-latest
# Ensure that the job runs only when the PR is opened by dependabot
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Git checkout
uses: actions/checkout@v4
# Installs the CLI-beta in a python venv
# - name: Installing CLI-beta for OpenID Connect
# run: |
# cd ../..
# CWD="$(pwd)"
# python3 -m venv oidc-venv
# . oidc-venv/bin/activate
# echo "activated environment"
# python3 -m pip install -q --upgrade pip
# echo "started installing cli beta"
# pip install -q --extra-index-url https://azcliprod.blob.core.windows.net/beta/simple/ azure-cli
# echo "***************installed cli beta*******************"
# echo "$CWD/oidc-venv/bin" >> $GITHUB_PATH
# Logs into Azure via OIDC (note no password)
- name: 'Az OIDC CLI login'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENTID }}
tenant-id: ${{ secrets.AZURE_TENANTID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTIONID }}
# Name of the environment. Supported values are azurecloud, azurestack, azureusgovernment, azurechinacloud, azuregermancloud. Default being azurecloud
# environment: azurecloud
- name: Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore package dependencies
run: dotnet restore
- name: dotet build
run: dotnet build --no-restore --configuration Release
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: zip package
run: |
cd ${{env.DOTNET_ROOT}}/myapp
zip -r myapp.zip .
- name: Azure CLI Publish
run: az webapp deployment source config-zip -g rgDoNotDeleteDemos -n ${{secrets.APP_NAME}} --slot test --src ${{env.DOTNET_ROOT}}/myapp/myapp.zip
test:
name: Smoke Test Dev Slot
runs-on: ubuntu-latest
needs: build
# Ensure that the job runs only when the PR is opened by dependabot
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install pytest
run: |
python -m pip install --upgrade pip
pip install pytest
pip install requests
- name: Test with pytest
run: |
cd QrCodeApiApp/test
pytest --url ${{secrets.TEST_URL}}