-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (79 loc) · 2.36 KB
/
Copy pathdotnet.yml
File metadata and controls
96 lines (79 loc) · 2.36 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
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
10.0.x
- name: NuGet cache
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', '**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore
run: dotnet restore XSpecification.slnx
- name: Build
run: dotnet build XSpecification.slnx -c Release --no-restore
- name: Test
run: dotnet test XSpecification.slnx -c Release --no-build --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" --results-directory ./TestResults
- name: Upload test results
uses: actions/upload-artifact@v7
if: always()
with:
name: test-results
path: ./TestResults/**/*.trx
- name: Upload coverage
uses: actions/upload-artifact@v7
if: always()
with:
name: coverage
path: ./TestResults/**/coverage.cobertura.xml
- name: Codecov
uses: codecov/codecov-action@v7
if: always()
with:
files: ./TestResults/**/coverage.cobertura.xml
fail_ci_if_error: false
continue-on-error: true
pack:
name: Pack (preview)
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
10.0.x
- name: Pack
run: dotnet pack XSpecification.slnx -c Release -o ./artifacts --version-suffix "preview.${{ github.run_number }}"
- name: Upload packages
uses: actions/upload-artifact@v7
with:
name: nupkg-preview
path: ./artifacts/*.*nupkg