-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 2.79 KB
/
Copy pathci.yml
File metadata and controls
100 lines (86 loc) · 2.79 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
96
97
98
99
100
name: Build & Test
on:
pull_request:
branches: ["main", "release-next"]
paths-ignore:
- "docs/**"
- "notes/**"
- "*.md"
- ".github/workflows/docs.yml"
- ".github/workflows/commitlint.yml"
- ".github/workflows/codeql.yml"
- ".github/workflows/release.yml"
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
GLOBAL_JSON_PATH: "./src/global.json"
PROJECT_PATH: "./src/GaudiHTTP.slnx"
TEST_OUTPUT_DIRECTORY: "${{ github.workspace }}/testresults"
COVERAGE_REPORT_DIRECTORY: "./coveragereport"
permissions:
contents: read
checks: write
pull-requests: write
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: [kestrel, docker]
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 1
submodules: true
- name: Install libmsquic (QUIC/HTTP3 support)
run: |
wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update -qq
sudo apt-get install -y -qq libmsquic > /dev/null
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: ${{ env.GLOBAL_JSON_PATH }}
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('src/Directory.Packages.props', 'src/**/*.csproj', 'lib/**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build
run: >
dotnet build
--configuration Release
--no-restore
${{ env.PROJECT_PATH }}
- name: Run tests (backend=${{ matrix.backend }})
working-directory: "./src"
env:
GAUDIHTTP_TEST_BACKEND: ${{ matrix.backend }}
run: >
dotnet test
--configuration Release
--no-ansi
--no-build
--coverage
--coverage-output-format cobertura
--results-directory ${{ env.TEST_OUTPUT_DIRECTORY }}
--max-parallel-test-modules 2
--solution *.slnx
- name: Report Code Coverage
if: always()
uses: danielpalme/ReportGenerator-GitHub-Action@5
with:
reports: "${{ env.TEST_OUTPUT_DIRECTORY }}/*cobertura.xml"
targetdir: "${{ env.COVERAGE_REPORT_DIRECTORY }}"
reporttypes: "MarkdownSummaryGithub"
- name: Add Coverage Summary to Job Summary
if: always()
run: cat ${{ env.COVERAGE_REPORT_DIRECTORY }}/SummaryGithub.md >> $GITHUB_STEP_SUMMARY