-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (81 loc) · 2.33 KB
/
Copy pathdotnet.yml
File metadata and controls
97 lines (81 loc) · 2.33 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
# SPDX-FileCopyrightText: 2024 Frans van Dorsselaer
#
# SPDX-License-Identifier: MIT
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
issues: read
checks: write
pull-requests: write
id-token: write
attestations: write
jobs:
build:
runs-on: ubuntu-latest
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
cache: true
cache-dependency-path: |
global.json
'**/Directory.Packages.props'
.config/dotnet-tools.json
- name: Install dependencies
run: |
dotnet tool restore
dotnet restore
- name: Build
run: |
dotnet build --configuration Release --no-restore
- name: Test
run: |
dotnet test --configuration Release --no-build \
--report-spekt-junit \
--coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
- name: Package
run: |
dotnet pack --configuration Release --no-build
- name: Upload Package Artifact
id: upload
uses: actions/upload-artifact@v7
with:
name: artifacts
path: |
**/*.nupkg
**/*.snupkg
retention-days: 14
- name: Build Attestation
uses: actions/attest@v4
with:
subject-name: artifacts.zip
subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
report_type: test_results
files: '**/TestResults/TestResults.xml'
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: '**/TestResults/coverage.cobertura.xml'
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}