-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 1.06 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
name: Build and test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set version number
shell: pwsh
run: |
$version = "0.0.$(Get-Date -Format "yyMM.dd")$(($Env:GITHUB_RUN_NUMBER % 100).ToString("00"))"
echo $version
echo "VERSION_NUMBER=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore -property:Version=${{ env.VERSION_NUMBER }}
- name: Build
run: dotnet build --no-restore -property:Version=${{ env.VERSION_NUMBER }}
- name: Test
run: dotnet test --no-build --verbosity normal --logger trx
- name: Report Tests
uses: dorny/[email protected]
with:
reporter: dotnet-trx
path: "${{ github.workspace }}/**/*.trx"
name: Unit Tests