forked from Azure/azure-functions-openapi-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (88 loc) · 2.61 KB
/
pr.yaml
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
name: Pull Request
on:
pull_request:
branches:
- main
- v2
- v3
jobs:
build_and_test:
name: Build and test
strategy:
matrix:
os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Setup Azure Functions Core Tools
shell: pwsh
run: |
npm install -g azure-functions-core-tools@4 --unsafe-perm true
# - name: Setup .NET SDK 3.1 LTS
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'
# - name: Setup .NET SDK 5
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '5.x'
- name: Setup .NET SDK 6 LTS
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
- name: Setup .NET SDK 7 STS
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
# - name: Add MSBuild to PATH
# uses: microsoft/[email protected]
- name: Clear NuGet local cache
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
dotnet nuget locals all --clear
- name: Restore NuGet packages
shell: pwsh
run: |
dir
dotnet restore .
- name: Build solution
shell: pwsh
run: |
dir
dotnet build . -c Debug -v minimal
- name: Run unit tests
shell: pwsh
run: |
dir
dotnet test . -c Debug --filter:"TestCategory!=Integration"
- name: Run integration tests (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
dir
$rootDir = $pwd.Path
$func = $(Get-Command func).Source.Replace(".ps1", ".cmd")
cd ./test-integration/Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp
Start-Process -NoNewWindow "$func" @("start","--verbose","false")
Start-Sleep -s 60
cd $rootDir/test-integration/Microsoft.Azure.WebJobs.Extensions.OpenApi.Document.Tests
dotnet test . -c Debug
cd $rootDir
- name: Run integration tests (Non-Windows)
if: matrix.os != 'windows-latest'
shell: pwsh
run: |
dir
$rootDir = $pwd.Path
cd ./test-integration/Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp
Start-Process -NoNewWindow func @("start","--verbose","false")
Start-Sleep -s 60
cd $rootDir/test-integration/Microsoft.Azure.WebJobs.Extensions.OpenApi.Document.Tests
dotnet test . -c Debug
cd $rootDir