-
Notifications
You must be signed in to change notification settings - Fork 102
90 lines (73 loc) · 3.23 KB
/
Automate.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
name: "Automate"
# Run an app with automation thanks to imgui_test_engine, and ensure it works.
# i.e. the graphic app is launched, some buttons are clicked, and the app exits with a success code.
on:
workflow_dispatch:
pull_request:
push:
jobs:
build:
name: Automate
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest]
# platform: [windows-latest, ubuntu-latest]
# this does not work under macos-latest (may be "Off-screen Mesa" could help)
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: apt install libglfw3-dev xorg-dev libfreetype-dev (ubuntu only)
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: sudo apt-get update && sudo apt-get install -y xorg-dev libglfw3-dev libfreetype-dev
- name: Install & Start Xvfb (ubuntu only)
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: |
sudo apt-get install -y xvfb
Xvfb :99 &
echo "DISPLAY=:99.0" >> $GITHUB_ENV
- name: Build
shell: bash
run: |
cd .github/ci_automation_tests
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DHELLOIMGUI_WIN32_NO_CONSOLE=OFF -DHELLOIMGUI_WIN32_AUTO_WINMAIN=OFF -DHELLOIMGUI_DOWNLOAD_FREETYPE_IF_NEEDED=ON
cmake --build . -j 3 --config Release
- name: install mesa OpenGL software renderer (windows only)
shell: bash
if: ${{ matrix.platform == 'windows-latest' }}
run: |
# Download the archive
curl -L -O https://github.com/pal1000/mesa-dist-win/releases/download/23.1.9/mesa3d-23.1.9-release-msvc.7z
# Extract the archive using 7-zip which is preinstalled on the GitHub Actions Windows runner
7z x mesa3d-23.1.9-release-msvc.7z -omesa3d
# Optionally move/copy the required DLLs to the directory of your executable
# For this example, I'll assume your executable is in '.github/ci_automation_tests/build'
# Copy the opengl32.dll to your executable directory
cp mesa3d/x64/*.* .github/ci_automation_tests/build/Release
# - name: Setup interactive tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run Automation Test (windows)
shell: bash
if: ${{ matrix.platform == 'windows-latest' }}
run: |
cd .github/ci_automation_tests/build/Release
# Run the application, but don't exit the script even if it fails
# Under windows, the app works well a local machine and on GitHub CI
# However it ends with a segfault on Github CI, althought it did run to the end.
# Let's detect this via an old-style hack.
./ci_automation_test_app.exe || true
# Now check for the success file
if [[ ! -f ci_automation_test_app_success.txt ]]; then
echo "Error: ci_automation_test_app_success.txt not found!"
exit 1
fi
- name: Run Automation Test (nixes)
shell: bash
if: ${{ matrix.platform != 'windows-latest' }}
run: |
cd .github/ci_automation_tests/build
./ci_automation_test_app