-
Notifications
You must be signed in to change notification settings - Fork 287
95 lines (80 loc) · 2.64 KB
/
validate-build-e2e.yml
File metadata and controls
95 lines (80 loc) · 2.64 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
name: Validate Build (E2E tests)
permissions:
contents: read
on:
push:
branches:
- main
- dev
paths-ignore: [ '**.md' ]
pull_request:
branches:
- '*'
paths-ignore: [ '**.md' ]
env:
config: Release
AzureWebJobsStorage: UseDevelopmentStorage=true
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
framework: [net8.0, net10.0]
name: E2E (${{ matrix.framework }})
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
10.0.x
global-json-file: global.json
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore ./test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj
- name: Build
run: dotnet build ./test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj --no-restore
- name: Set up Node.js (needed for Azurite)
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Cache npm packages
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-azurite
- name: Install Azurite
shell: pwsh
run: |
New-Item -ItemType Directory -Path .azurite -Force
Set-Location .azurite
'{"name":"azurite-local","private":true}' | Set-Content package.json
npm install azurite
- name: Start Azurite
shell: pwsh
run: |
Start-Process (Resolve-Path '.azurite\node_modules\.bin\azurite.cmd') -ArgumentList '--silent','--skipApiVersionCheck','--blobPort','10000','--queuePort','10001','--tablePort','10002'
$timeout = 30
for ($i = 1; $i -le $timeout; $i++) {
try {
$tcp = [System.Net.Sockets.TcpClient]::new('127.0.0.1', 10000)
$tcp.Dispose()
Write-Host "Azurite is ready"
break
} catch {
if ($i -eq $timeout) { throw "Azurite did not start within $timeout seconds" }
Write-Host "Waiting for Azurite ($i/$timeout)"
Start-Sleep -Seconds 1
}
}
- name: Run FunctionsV2 E2E tests - ${{ matrix.framework }}
run: dotnet test ./test/FunctionsV2/WebJobs.Extensions.DurableTask.Tests.V2.csproj --framework ${{ matrix.framework }} --no-build --filter "TestType=E2E" -- xunit.maxParallelThreads=1