-
Notifications
You must be signed in to change notification settings - Fork 22
92 lines (71 loc) · 2.32 KB
/
build.yml
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
name: build
on:
push:
branches:
- master
pull_request:
env:
DOTNET_NOLOGO: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
filter: blob:none # We don't need all blobs
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
- uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: |
6
8
dotnet-quality: ga
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore ./MimeMapping.sln
- name: test
run: dotnet test --no-build ./MimeMapping.sln
- name: Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: '**/TestResults/*/*.cobertura.xml'
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: [test]
runs-on: windows-latest
timeout-minutes: 15
env:
CONFIGURATION: Release
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172
filter: blob:none # We don't need all blobs
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
- name: restore
run: dotnet restore
- name: build
run: dotnet build -c release --no-restore
- name: pack
run: dotnet pack -o bin --no-build
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: packages
path: bin/*.nupkg