diff --git a/.github/workflows/main.yml b/.github/workflows/build.yml similarity index 96% rename from .github/workflows/main.yml rename to .github/workflows/build.yml index dbae5ce3..54ed21d6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/build.yml @@ -9,10 +9,10 @@ jobs: run: shell: msys2 {0} steps: - - name: 'Sync source code' + - name: Fetch Source Code uses: actions/checkout@v4 with: - submodules: 'recursive' + submodules: recursive - name: Install Dependencies uses: msys2/setup-msys2@v2 with: @@ -35,10 +35,10 @@ jobs: mac-os: runs-on: macos-latest steps: - - name: 'Sync source code' + - name: Fetch Source Code uses: actions/checkout@v4 with: - submodules: 'recursive' + submodules: recursive - name: Install Dependencies run: | brew install meson ninja sdl2 glew create-dmg @@ -130,10 +130,10 @@ jobs: linux: runs-on: ubuntu-latest steps: - - name: 'Sync source code' + - name: Fetch Source Code uses: actions/checkout@v4 with: - submodules: 'recursive' + submodules: recursive - name: Install Dependencies run: | sudo apt-get update diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..2583927a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,92 @@ +name: Accuracy Checks + +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: Download Test Roms + run: | + mkdir roms + cd 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 + - name: Build Hades w/ Debugger + run: | + meson build --werror -Dwith_debugger=true + cd build + ninja + - 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 + + cat config.json + + # Run accuracy checks + cat << EOF | ./build/hades ./roms/arm.gba + r + f 10 + r + exit + EOF + ls -l + +# windows: +# runs-on: windows-latest +# defaults: +# run: +# shell: msys2 {0} +# steps: +# - name: Fetch Source Code +# uses: actions/checkout@v4 +# with: +# submodules: 'recursive' +# - name: Install Dependencies +# uses: msys2/setup-msys2@v2 +# with: +# install: make mingw-w64-x86_64-meson mingw-w64-x86_64-ninja mingw-w64-x86_64-pkg-config mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew mingw-w64-x86_64-readline mingw-w64-x86_64-wineditline mingw-w64-x86_64-capstone +# - name: Build Hades /w Debugger +# run: | +# meson build -Dwith_debugger=true +# cd build +# ninja +# - name: Check Accuracy +# run: | +# ./build/Hades.exe --help