-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (87 loc) · 3.09 KB
/
develop.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
name: Develop Workflow
on:
push:
branches-ignore:
- 'release'
pull_request_target:
branches-ignore:
- 'release'
permissions:
actions: write
checks: write
contents: write
issues: write
pull-requests: write
jobs:
build-and-test:
name: Build & Test
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
versionSpec: '5.12.0'
- name: Determine Version
id: version_step
uses: gittools/actions/gitversion/execute@v3.0.0
with:
useConfigFile: true
- name: Push New Version Tag
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: |
$gv = 'v${{ steps.version_step.outputs.majorMinorPatch }}' #gitversion result
$lt = $( git describe --tags --abbrev=0 ) # last tag version result
if ( -Not ( $gv -eq $lt ) )
{
git tag $gv
git push origin --tags
}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Release -v n
- name: Unit Tests
run: |
dotnet test -c Release ./tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj --no-build -v n
dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build -v n --filter="Category=Unit"
mkdir coverage-report
- name: Code Coverage Summary Report For Merge Request
if: github.event_name == 'pull_request_target'
uses: 5monkeys/cobertura-action@master
with:
path: ./tests/HydraScript.Tests/coverage.cobertura.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 20
fail_below_threshold: true
show_class_names: true
show_missing: true
link_missing_lines: true
show_branch: true
only_changed_files: true
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1
with:
reports: './tests/HydraScript.Tests/coverage.cobertura.xml'
targetdir: './coverage-report'
- name: Upload coverage report artifact
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: CoverageReport
path: coverage-report
- name: Integration Tests
run: dotnet test -c Release --no-build -v n --filter="Category=Integration"
- name: Upload Windows Build
if: github.ref != 'refs/heads/master' && github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: windows_build_${{ steps.version_step.outputs.fullSemVer }}
path: ./src/HydraScript/bin/Release/net8.0