-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.01 KB
/
Copy pathci.yml
File metadata and controls
82 lines (68 loc) · 2.01 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
name: ci
on:
push:
branches: [main]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
pull_request:
branches: [main]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CI: true
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
# net462 tests only run on Windows.
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
# global.json pins the SDK to 10.0.100. 8.0.x is here for the net8.0 test runtime.
dotnet-version: |
8.0.x
10.0.x
- name: Cache NuGet packages
uses: actions/cache@v6
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/Directory.*.props', 'global.json') }}
restore-keys: nuget-${{ runner.os }}-
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
if: github.event_name == 'pull_request'
run: dotnet test --no-build -c Release --logger trx
- name: Test with coverage
if: github.event_name != 'pull_request'
run: dotnet test --no-build -c Release --logger trx --collect:"XPlat Code Coverage"
- name: Pack
run: dotnet pack --no-build -c Release -o artifacts/packages
- name: Upload test results
if: failure() || github.event_name == 'push'
uses: actions/upload-artifact@v7
with:
name: test-results
path: tests/*/TestResults/**
- name: Upload packages
if: github.event_name == 'push'
uses: actions/upload-artifact@v7
with:
name: packages
path: artifacts/packages/*