-
-
Notifications
You must be signed in to change notification settings - Fork 241
84 lines (69 loc) · 2.25 KB
/
build-installer.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
# SPDX-FileCopyrightText: 2020 Frans van Dorsselaer
#
# SPDX-License-Identifier: GPL-3.0-only
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
issues: read
checks: write
pull-requests: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
# NOTE: caching seems to actually slow down the build, both on hit and on miss
cache: false
cache-dependency-path: '**/packages.lock.json'
- name: Install dependencies
run: |
dotnet tool restore
dotnet restore
dotnet restore Installer
- name: Build
run: |
dotnet build --configuration Release --no-restore
- name: Test
run: |
dotnet test --configuration Release --no-build `
-p:TestingPlatformCommandLineArguments="--report-trx --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml"
- name: Build (Installer)
run: |
dotnet publish --configuration Release --no-build Usbipd
dotnet publish --configuration Release --no-build Usbipd.PowerShell
dotnet build --configuration Release --no-restore Installer
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: msi-installer
path: 'Installer/bin/x64/release/*.msi'
- name: Convert test results
if: ${{ !cancelled() }}
shell: bash
run: |
find . -name "*.trx" -exec dotnet tool run trx2junit --output TestResults/JUnit {} +
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: true
files: TestResults/JUnit/*.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}