Repository navigation
108 lines (93 loc) · 3.23 KB
/
Copy pathci.yml
File metadata and controls
108 lines (93 loc) · 3.23 KB
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
104
105
106
107
108
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
# Read-only: this workflow only builds, tests, and uploads action artifacts.
permissions:
contents: read
# Cancel superseded PR runs; never cancel a push run mid-build.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build-and-test:
name: build-and-test
# The app targets net10.0-windows and DokanNet; only Windows runners can run it.
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Setup .NET
# 10.0.x, not `global-json-file`: the repo pins `10.0.0` with
# rollForward latestMajor, which setup-dotnet cannot resolve.
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: |
**/*.csproj
global.json
- name: Restore
run: dotnet restore CSharp_SimpleXisoDrive.sln
- name: Build
run: dotnet build CSharp_SimpleXisoDrive.sln --no-restore --configuration Release
- name: Test
# --blame-hang-dump-type none: hang dumps are too large to upload, so skip
# collecting them and abort faster on a hung test host.
run: >-
dotnet test CSharp_SimpleXisoDrive.sln
--no-build --configuration Release
--collect:"XPlat Code Coverage"
--logger "trx;LogFileName=results.trx"
--results-directory TestResults
--blame-hang-timeout 15m
--blame-hang-dump-type none
- name: Upload test results
# Always: the trx of a failed run carries the failing test and timings.
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results
path: TestResults/**/*.trx
if-no-files-found: warn
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: TestResults/**/coverage.cobertura.xml
if-no-files-found: warn
build-unix:
name: build-unix
# The Unix app targets net10.0 and P/Invokes libfuse3; build and publish it on
# Linux to catch platform-specific regressions (mounting needs a FUSE device,
# which hosted runners do not provide, so this job does not mount anything).
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
cache: true
cache-dependency-path: |
**/*.csproj
global.json
- name: Build Unix app
run: dotnet build SimpleXisoDrive.Unix/SimpleXisoDrive.Unix.csproj --configuration Release
- name: Publish linux-x64
run: >-
dotnet publish SimpleXisoDrive.Unix/SimpleXisoDrive.Unix.csproj
--configuration Release
--runtime linux-x64
--self-contained false
-p:PublishSingleFile=true
--output publish/linux-x64