-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 1.84 KB
/
ci.yml
File metadata and controls
74 lines (62 loc) · 1.84 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
GLOBAL_JSON_PATH: "./src/global.json"
PROJECT_PATH: "./src/TurboHTTP.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
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: ${{ env.GLOBAL_JSON_PATH }}
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build
run: >
dotnet build
--configuration Release
--no-restore
${{ env.PROJECT_PATH }}
- name: Install libmsquic
run: |
sudo apt-get update
sudo apt-get install -y libmsquic
- name: Run tests
working-directory: "./src"
run: >
dotnet test
--configuration Release
--no-ansi
--no-build
--coverage
--coverage-output-format cobertura
--results-directory ${{ env.TEST_OUTPUT_DIRECTORY }}
--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