-
-
Notifications
You must be signed in to change notification settings - Fork 50
127 lines (107 loc) · 4.33 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: build-test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
timeout-minutes: 60
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
framework: [net462, net48, net8.0]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.framework }}
cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build project
run: dotnet build -bl:build.binlog -c Release
- name: Get Path to Tests
run: echo "TEST_PATH=$(dotnet msbuild SIL.Core.Tests/ --getProperty:OutputPath -p:TargetFramework=${{ matrix.framework }} -p:Configuration=Release)" >> $GITHUB_ENV
# Several steps to set up FFmpeg and Scream and start Audio Service so that audio tests can run
- name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
with:
ffmpeg-version: release
- run: echo ffmpeg path ${{ steps.setup-ffmpeg.outputs.ffmpeg-path }}
- name: Verify FFmpeg Installation
run: |
echo $PATH
ffmpeg -version
- name: Install Scream
shell: powershell
run: |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip
Expand-Archive -Path Scream4.0.zip -DestinationPath Scream
openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req
openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:
- name: Setup MSVC Dev Cmd
uses: ilammy/msvc-dev-cmd@v1
- name: Sign and Install Scream Driver
shell: powershell
run: |
signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
timeout-minutes: 5
- name: Install Virtual Audio Cable
shell: powershell
run: |
# Download the ZIP file
curl -o "VBCABLE_Driver_Pack45.zip" "https://download.vb-audio.com/Download_CABLE/VBCABLE_Driver_Pack45.zip"
# Extract the ZIP file
Expand-Archive -Path "VBCABLE_Driver_Pack45.zip" -DestinationPath "./VBCABLE_Driver"
# Run the installer silently (adjust the file name if necessary)
Start-Process -FilePath "./VBCABLE_Driver/VBCABLE_Setup.exe" -ArgumentList "/silent" -NoNewWindow -Wait
# Clean up
Remove-Item -Recurse -Force "VBCABLE_Driver_Pack45.zip"
Remove-Item -Recurse -Force "VBCABLE_Driver_Pack45"
- name: Start Windows Audio Service
run: net start audiosrv
shell: powershell
# there are cases where this will fail and we want to know about it
# so we don't use continue-on-error, but we still want to publish the results
- name: Test project
id: test
run: dotnet test "$TEST_PATH"/SIL*Tests.dll --filter "TestCategory != SkipOnTeamCity" --blame-hang-timeout 5m --logger:"trx;LogFilePrefix=results" --results-directory ./test-results
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test results (${{ matrix.framework }})
path: ./test-results
- name: Publish logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: binary-logs (${{ matrix.framework }})
path: build.binlog
publish-test-results:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Download test results
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: Test results *
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
with:
check_name: Palaso Tests
files: artifacts/**/*.trx
action_fail: true
action_fail_on_inconclusive: true