-
-
Notifications
You must be signed in to change notification settings - Fork 12
97 lines (95 loc) · 3.4 KB
/
build-and-publish.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
93
94
95
96
97
name: C# Build, Test and Publish
on:
push:
branches: [ master, refactor-reloaded3-compliance, support-android-and-bsd ]
tags:
- '*'
pull_request:
branches: [ master, refactor-reloaded3-compliance, support-android-and-bsd ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-13
targetFramework:
- net7.0
- net6.0
- net5.0
- netcoreapp3.1
platform:
- x64
include:
- os: windows-latest
targetFramework: net48
platform: x64
- os: windows-latest
targetFramework: net48
platform: x86
- os: windows-latest
targetFramework: net7.0
platform: x86
- os: windows-latest
targetFramework: net6.0
platform: x86
- os: windows-latest
targetFramework: net5.0
platform: x86
- os: windows-latest
targetFramework: netcoreapp3.1
platform: x86
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- name: Setup Reloaded Library SDKs & Components
uses: Reloaded-Project/Reloaded.Project.Configurations/.github/actions/setup-sdks-components@main
- name: Build Library
run: dotnet build -f ${{ matrix.targetFramework }} ./src/Reloaded.Memory.Buffers.Tests/Reloaded.Memory.Buffers.Tests.csproj
- name: Run Tests
run: dotnet test -f ${{ matrix.targetFramework }} ./src/Reloaded.Memory.Buffers.Tests/Reloaded.Memory.Buffers.Tests.csproj --collect:"XPlat Code Coverage;" --results-directory "Coverage"
- name: "Upload Coverage"
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.os }}-${{ matrix.targetFramework }}
path: Coverage/*/coverage.cobertura.xml
upload:
needs: build
runs-on: ubuntu-latest
steps:
- name: "Checkout Code"
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- name: "Setup Reloaded Library SDKs & Components"
uses: Reloaded-Project/Reloaded.Project.Configurations/.github/actions/setup-sdks-components@main
- name: Build Library
run: dotnet build -c Release ./src
- name: "Install ReportGenerator"
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: "Download Coverage Artifacts"
uses: actions/download-artifact@v3
with:
path: artifacts
- name: "Merge Coverage Files"
run: |
dotnet tool install --global dotnet-coverage
dotnet-coverage merge ./artifacts/*.cobertura.xml --recursive --output ./Cobertura.xml --output-format xml
- name: "Upload Coverage & Packages"
uses: Reloaded-Project/Reloaded.Project.Configurations/.github/actions/upload-coverage-packages@main
with:
code-coverage-path: './Cobertura.xml'
changelog-path: './Changelog.md'
nupkg-glob: '**.nupkg'
snupkg-glob: '**.snupkg'
nuget-key: ${{ secrets.NUGET_KEY }}
changelog-template: 'keepachangelog'
is-release: ${{ startsWith(github.ref, 'refs/tags/') }}
release-tag: ${{ github.ref_name }}