-
Notifications
You must be signed in to change notification settings - Fork 253
90 lines (75 loc) · 2.89 KB
/
ci-cd.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
name: CI/CD Pipeline
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
env:
ARTIFACTS_FOLDER: ${{ github.workspace }}/Artifacts
GITHUB_RUN_NUMBER: ${{ github.run_number }}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Build projects
id: build_projects
shell: pwsh
run: |
dotnet build Microsoft.OpenApi.sln -c Release
- name: Run unit tests
id: run_unit_tests
shell: pwsh
run: |
dotnet test Microsoft.OpenApi.sln -c Release -v n
validate-trimming:
name: Validate Project for Trimming
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Validate Trimming warnings
run: dotnet publish -c Release -r win-x64 /p:TreatWarningsAsErrors=true /warnaserror -f net8.0
working-directory: ./test/Microsoft.OpenApi.Trimming.Tests
validate-performance:
name: Validate performance of the library
runs-on: ubuntu-latest
needs: [ci]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Copy committed results
run: |
mkdir -p ./performanceResults
cp -r ./performance/benchmark/BenchmarkDotNet.Artifacts/results/* ./performanceResults
- name: Run performance tests
run: |
dotnet run -c Release
working-directory: ./performance/benchmark
- name: Run comparison tool for empty models
run: dotnet run -c Release --project ./performance/resultsComparer/resultsComparer.csproj -- compare $OLD_REPORT $NEW_REPORT -p IdenticalMemoryUsage
shell: bash
env:
NEW_REPORT: "${{ github.workspace }}/performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.EmptyModels-report.json"
OLD_REPORT: "${{ github.workspace }}/performanceResults/performance.EmptyModels-report.json"
- name: Run comparison tool for descriptions
run: dotnet run -c Release --project ./performance/resultsComparer/resultsComparer.csproj -- compare $OLD_REPORT $NEW_REPORT -p ZeroPointTwoPercentDifferenceMemoryUsage
shell: bash
env:
NEW_REPORT: "${{ github.workspace }}/performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.Descriptions-report.json"
OLD_REPORT: "${{ github.workspace }}/performanceResults/performance.Descriptions-report.json"