-
-
Notifications
You must be signed in to change notification settings - Fork 140
103 lines (101 loc) · 3.26 KB
/
ci.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
98
99
100
101
102
103
name: CI Build
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
branches:
- '**'
workflow_call:
outputs:
version:
description: "Version"
value: ${{ jobs.build.outputs.version }}
version_MajorMinorPatch:
description: "Version (without prerelease tag)"
value: ${{ jobs.build.outputs.version_MajorMinorPatch }}
is_prerelease:
description: "Version prerelease ($true or $false)"
value: ${{ jobs.build.outputs.is_prerelease }}
jobs:
test:
name: Test
runs-on: windows-latest
permissions:
id-token: write
contents: read
checks: write
steps:
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '7.0.x'
include-prerelease: true
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run Tests
id: tests
run: ./build/02-test.ps1
- name: Test Report DotNet
uses: dorny/test-reporter@v1.5.0
if: success() || failure()
with:
name: TestsResults (dotnet)
path: "**/TestResults*.trx"
reporter: dotnet-trx
fail-on-error: true
- name: Test Report PowerShell v5
uses: dorny/test-reporter@v1.5.0
if: success() || failure()
with:
name: TestsResults (PowerShell v5)
path: ./testResults_PS5.xml
reporter: java-junit
fail-on-error: true
- name: Test Report PowerShell v7
uses: dorny/test-reporter@v1.5.0
if: success() || failure()
with:
name: TestsResults (PowerShell v7)
path: ./testResults_PS7.xml
reporter: java-junit
fail-on-error: true
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '7.0.x'
include-prerelease: true
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: choco install GitVersion.Portable --version 5.6.11 --confirm --no-progress; choco install il-repack --confirm --no-progress
- name: Update project version
run: gitversion /l console /output buildserver /updateAssemblyInfo /verbosity minimal
- name: Get project version
id: getversion
run: |
echo "version=$(gitversion /showvariable LegacySemVer)" >> "$env:GITHUB_OUTPUT"
echo "version_MajorMinorPatch=$(gitversion /showvariable MajorMinorPatch)" >> "$env:GITHUB_OUTPUT"
if ("$(gitversion /showvariable PreReleaseTag)" -eq "") {
echo "is_prerelease=0" >> "$env:GITHUB_OUTPUT"
} else {
echo "is_prerelease=1" >> "$env:GITHUB_OUTPUT"
}
get-content "$env:GITHUB_OUTPUT"
- name: Build
run: ./build/01-build.ps1
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Binaries
path: ./artifacts
outputs:
version: ${{ steps.getversion.outputs.version }}
version_MajorMinorPatch: ${{ steps.getversion.outputs.version_MajorMinorPatch }}
is_prerelease: ${{ steps.getversion.outputs.is_prerelease }}