Repository navigation
172 lines (172 loc) · 7.52 KB
/
Copy pathbuild.yml
File metadata and controls
172 lines (172 loc) · 7.52 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Desktop and WebAssembly
on:
push:
pull_request:
permissions:
contents: read
jobs:
native:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
- os: ubuntu-24.04-arm
rid: linux-arm64
- os: windows-latest
rid: win-x64
- os: windows-11-arm
rid: win-arm64
- os: macos-latest
rid: osx-arm64
- os: macos-15-intel
rid: osx-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Install Linux desktop and qualification dependencies
if: runner.os == 'Linux'
run: sudo apt-get update -qq && sudo apt-get install -y clang zlib1g-dev xvfb libx11-6 libxtst6 libasound2t64
- name: Publish Native AOT
run: dotnet publish -c Release -r ${{ matrix.rid }} -o artifacts/${{ matrix.rid }}
- name: Generate original regression WADs in C#
run: dotnet run --project tools/e2e-fixtures/FixtureGenerator.csproj -c Release -- tools/e2e-fixtures/generated
- name: Run executable and engine regression checks
shell: bash
run: |
executable="artifacts/${{ matrix.rid }}/DoomSharp"
if [[ "${{ runner.os }}" == "Windows" ]]; then executable="${executable}.exe"; fi
dotnet run --project tools/Checks -c Release -- headless "$executable" tools/e2e-fixtures/generated artifacts/headless "${{ github.sha }}"
dotnet run --project tools/Checks -c Release -- engine "$executable" tools/e2e-fixtures/generated artifacts/engine "${{ github.sha }}"
- name: Run native headless scenario
shell: bash
run: |
executable="artifacts/${{ matrix.rid }}/DoomSharp"
if [[ "${{ runner.os }}" == "Windows" ]]; then executable="${executable}.exe"; fi
"$executable" --demo --headless --frames 35 --output artifacts/demo.ppm
- name: Exercise native desktop backend
shell: bash
run: |
executable="artifacts/${{ matrix.rid }}/DoomSharp"
if [[ "${{ runner.os }}" == "Linux" ]]; then
xvfb-run -a "$executable" --demo --no-audio --frames 35 --output artifacts/desktop.ppm
elif [[ "${{ runner.os }}" == "Windows" ]]; then
"${executable}.exe" --demo --no-audio --frames 35 --output artifacts/desktop.ppm
else
"$executable" --demo --no-audio --frames 35 --output artifacts/desktop.ppm
fi
- name: Play native demo through OS input
if: runner.os == 'Linux'
run: dotnet run --project tools/Checks -c Release -- native artifacts/${{ matrix.rid }}/DoomSharp tools/e2e-fixtures/generated artifacts/native "${{ github.sha }}"
- uses: actions/upload-artifact@v4
if: always()
with:
name: doomsharp-${{ matrix.rid }}
path: artifacts/
browser:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- run: dotnet workload install wasm-tools
- run: dotnet publish Browser/DoomSharp.Browser.csproj -c Release -o artifacts/browser
- run: dotnet run --project tools/e2e-fixtures/FixtureGenerator.csproj -c Release -- tools/e2e-fixtures/generated
- run: dotnet build tools/BrowserChecks -c Release
- name: Install browser
run: dotnet run --project tools/BrowserChecks -c Release -- install --with-deps ${{ matrix.browser }}
- name: Install virtual browser audio backend
run: sudo apt-get install -y pulseaudio
- name: Exercise published browser application
shell: bash
run: |
dotnet run --project tools/Serve -c Release -- artifacts/browser/wwwroot --urls http://127.0.0.1:5187 --path-base /doomsharp > artifacts/browser-host.log 2>&1 &
host=$!
pulse_socket="$RUNNER_TEMP/doomsharp-pulse.sock"
pulseaudio --daemonize=no --exit-idle-time=-1 --use-pid-file=no -n \
-L "module-native-protocol-unix socket=$pulse_socket auth-anonymous=1" \
-L "module-null-sink sink_name=doomsharp_test" > artifacts/browser-audio.log 2>&1 &
pulse=$!
export PULSE_SERVER="unix:$pulse_socket"
trap 'kill "$host" "$pulse" 2>/dev/null || true' EXIT
for attempt in {1..60}; do
if curl --silent --fail http://127.0.0.1:5187/doomsharp/ > /dev/null; then break; fi
sleep 1
done
curl --silent --fail http://127.0.0.1:5187/doomsharp/ > /dev/null
for attempt in {1..30}; do
if pactl info > /dev/null 2>&1; then break; fi
sleep 1
done
pactl info > artifacts/browser-audio-device.log
dotnet run --project tools/BrowserChecks -c Release -- http://127.0.0.1:5187/doomsharp/ tools/e2e-fixtures/generated artifacts/browser-checks ${{ matrix.browser }}
- uses: actions/upload-pages-artifact@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.browser == 'chromium'
with:
path: artifacts/browser/wwwroot
- uses: actions/upload-artifact@v4
if: always()
with:
name: doomsharp-browser-${{ matrix.browser }}
path: artifacts/
pages:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: browser
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: github-pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy tested browser application
id: deployment
uses: actions/deploy-pages@v4
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- run: dotnet run --project tools/e2e-fixtures/FixtureGenerator.csproj -c Release -- tools/e2e-fixtures/generated
- name: Install live browser check dependencies
run: |
dotnet run --project tools/BrowserChecks -c Release -- install --with-deps chromium
sudo apt-get install -y pulseaudio
- name: Verify live Pages gameplay
env:
PAGES_URL: ${{ steps.deployment.outputs.page_url }}
shell: bash
run: |
mkdir -p artifacts
pulse_socket="$RUNNER_TEMP/doomsharp-pages-pulse.sock"
pulseaudio --daemonize=no --exit-idle-time=-1 --use-pid-file=no -n \
-L "module-native-protocol-unix socket=$pulse_socket auth-anonymous=1" \
-L "module-null-sink sink_name=doomsharp_pages_test" > artifacts/pages-audio.log 2>&1 &
pulse=$!
export PULSE_SERVER="unix:$pulse_socket"
trap 'kill "$pulse" 2>/dev/null || true' EXIT
for attempt in {1..30}; do
if pactl info > /dev/null 2>&1; then break; fi
sleep 1
done
pactl info > artifacts/pages-audio-device.log
curl --fail --silent --show-error --retry 8 --retry-all-errors --retry-delay 5 "$PAGES_URL" > /dev/null
dotnet run --project tools/BrowserChecks -c Release -- "$PAGES_URL" tools/e2e-fixtures/generated artifacts/live-browser-checks chromium
- uses: actions/upload-artifact@v4
if: always()
with:
name: doomsharp-live-pages
path: artifacts/