-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.67 KB
/
build-test.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
name: Build & Test
on:
workflow_call:
jobs:
build:
name: Build & Test
runs-on: windows-latest # Run on Windows for now to use the pre-installed Cosmos Emulator
permissions:
id-token: write
contents: read
checks: write
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Check formatting
run: |
dotnet tool restore
dotnet csharpier --check .
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Start CosmosDb Emulator
shell: pwsh
run: |
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator
- name: Test
run: dotnet test --no-build
env:
TEST_COSMOS_CONNECTION_STRING: "AccountEndpoint=https://127.0.0.1:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: .NET Tests
path: .test-results/*.trx
reporter: dotnet-trx