-
Notifications
You must be signed in to change notification settings - Fork 10
101 lines (92 loc) · 3.24 KB
/
accuracy.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
name: Accuracy
on: [push, pull_request, workflow_dispatch]
jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Fetch Source Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y meson ninja-build libsdl2-dev libglew-dev libgtk-3-dev libreadline-dev libedit-dev libcapstone-dev
- name: Build Hades w/ Debugger
run: |
meson build --werror -Dwith_debugger=true
cd build
ninja
- name: Download Test Roms
run: |
# Download BIOS
echo "$BIOS_DATA" | base64 -d | gpg --pinentry-mode loopback --passphrase "$BIOS_KEY" -d -o ./bios.bin
# Create ROMs directory
mkdir roms
cd roms
# Download AGS
declare ags_url="$(echo "$AGS_URL" | base64 -d | gpg --pinentry-mode loopback --passphrase "$AGS_KEY" -d)"
wget "$ags_url" -O ags.zip
unzip ags.zip
shred -u ags.zip
mv AGB_*.gba ags.gba
# Download the remaining testing ROMs
wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/arm/arm.gba
wget https://raw.githubusercontent.com/jsmolka/gba-tests/master/thumb/thumb.gba
wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/dma-start-delay.gba
wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/openbus-bios.gba
wget https://raw.githubusercontent.com/Arignir/Hades-Tests/master/roms/timer-basic.gba
env:
BIOS_DATA: ${{ secrets.BIOS_DATA }}
BIOS_KEY: ${{ secrets.BIOS_KEY }}
AGS_URL: ${{ secrets.AGS_URL }}
AGS_KEY: ${{ secrets.AGS_KEY }}
- name: Check Accuracy
run: |
# Setup a fake audio environment
export SDL_AUDIODRIVER=disk
ln -s /dev/null sdlaudio.raw
# Setup a fake X11 environment
export DISPLAY=:99
sudo Xvfb -ac "$DISPLAY" -screen 0 1280x1024x24 > /dev/null 2>&1 &
# Setup the configuration
cat << EOF > config.json
{
"file": {
"bios": "./bios.bin"
},
"emulation": {
"skip_bios": true,
"speed": 0,
"unbounded": false,
"backup_storage": {
"autodetect": true,
"type": 0
},
"rtc": {
"autodetect": true,
"enabled": true
}
},
}
EOF
# Run accuracy checks
python3 ./tests/run.py --binary ./build/hades --roms ./roms/
- name: Collect Screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: tests-screenshots
path: './tests_screenshots/'
if-no-files-found: error
- name: Cleanup
if: always()
run: |
if [[ -f ./bios.bin ]]; then
shred -u ./bios.bin
echo "BIOS deleted"
fi
if [[ -f ./roms/ags.gba ]]; then
shred -u ./roms/ags.gba
echo "AGS deleted"
fi