-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (63 loc) · 2.7 KB
/
dotnet.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
name: .NET
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
env:
ProjectName: DryerDuty
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Initialize test reporting
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Restore
run: dotnet restore --locked-mode
- name: Build
run: |
dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime linux-arm --no-self-contained
dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime linux-arm64 --no-self-contained
- name: Publish
run: |
dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime linux-arm --no-self-contained
dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime linux-arm64 --no-self-contained
- name: Test
shell: bash
run: |
dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
echo "TEST_EXIT_CODE=$?" >> $GITHUB_ENV
cp Tests/TestResults/*/coverage.info Tests/TestResults
exit 0
- name: Upload test report
run: testspace Tests/TestResults/TestResults.xml
- name: Upload coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: Tests/TestResults/coverage.info
- name: Stop if tests failed
run: exit ${{ env.TEST_EXIT_CODE }}
- name: Upload ARM32 artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}-linux-arm32
path: |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/${{ env.ProjectName }}
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/appsettings.json
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/*.service
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/*.so
if-no-files-found: error
- name: Upload ARM64 artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}-linux-arm64
path: |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/${{ env.ProjectName }}
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/appsettings.json
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/*.service
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/*.so
if-no-files-found: error