-
Notifications
You must be signed in to change notification settings - Fork 246
92 lines (79 loc) · 2.31 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: ["main"]
paths:
- 'src/**'
pull_request:
branches: ["main"]
paths:
- 'src/**'
- '.github/workflows/build.yml'
jobs:
analyze:
name: test and pack
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
preferLatestVersion: true
- name: Determine version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
updateAssemblyInfo: true
useConfigFile: true
configFilePath: gitversion.yml
- name: Show version
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x'
dotnet-quality: 'ga'
- name: Build solution
run: >
dotnet build
--configuration Release
--property:Version=${{ steps.gitversion.outputs.nuGetVersion }}
--property:ContinuousIntegrationBuild=true
-warnaserror
- name: Test library
run: >
dotnet test
--configuration Release
--no-build
--logger trx
--results-directory "TestResults"
--collect "Code Coverage"
- name: Save test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: TestResults
if: ${{ always() }}
- name: Pack for NuGet
run: >
dotnet pack src/Indicators.csproj
--configuration Release
--no-build
--include-symbols
--output NuGet
- name: Save NuGet package
uses: actions/upload-artifact@v3
with:
name: packages
path: NuGet
if: ${{ always() }}