Repository navigation
50 lines (47 loc) · 1.83 KB
/
Copy pathbuild.yml
File metadata and controls
50 lines (47 loc) · 1.83 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
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
# Includes the schema-validation, template, async, ASP.NET Core and reader fuzz tests.
- name: Test with coverage
run: dotnet test --no-build -c Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory coverage
- name: Coverage summary
run: |
python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY"
import glob, xml.etree.ElementTree as ET
files = glob.glob("coverage/**/coverage.cobertura.xml", recursive=True)
root = ET.parse(files[0]).getroot()
print("## Code coverage")
print(f"Line coverage: **{float(root.get('line-rate')) * 100:.1f}%**, branch coverage: **{float(root.get('branch-rate')) * 100:.1f}%**")
print()
print("| Package | Lines |")
print("|---|---|")
for p in root.iter("package"):
print(f"| {p.get('name')} | {float(p.get('line-rate')) * 100:.1f}% |")
PY
- name: Pack
run: |
dotnet pack src/SheetStream/SheetStream.csproj --no-build -c Release -o artifacts
dotnet pack src/SheetStream.AspNetCore/SheetStream.AspNetCore.csproj --no-build -c Release -o artifacts
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: nupkg
path: artifacts/*.nupkg