diff --git a/.github/actions/LICENSE b/.github/actions/LICENSE new file mode 100644 index 0000000..8c295a2 --- /dev/null +++ b/.github/actions/LICENSE @@ -0,0 +1,25 @@ +Blargg's Test ROMs by Shay Green + +Acid2 tests by Matt Currie under MIT: + +MIT License + +Copyright (c) 2020 Matt Currie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/.github/actions/cgb-acid2.gbc b/.github/actions/cgb-acid2.gbc new file mode 100644 index 0000000..5f71bd3 Binary files /dev/null and b/.github/actions/cgb-acid2.gbc differ diff --git a/.github/actions/cgb_sound.gb b/.github/actions/cgb_sound.gb new file mode 100644 index 0000000..dc50471 Binary files /dev/null and b/.github/actions/cgb_sound.gb differ diff --git a/.github/actions/dmg-acid2.gb b/.github/actions/dmg-acid2.gb new file mode 100644 index 0000000..a25ef94 Binary files /dev/null and b/.github/actions/dmg-acid2.gb differ diff --git a/.github/actions/dmg_sound-2.gb b/.github/actions/dmg_sound-2.gb new file mode 100755 index 0000000..52dcf70 Binary files /dev/null and b/.github/actions/dmg_sound-2.gb differ diff --git a/.github/actions/oam_bug-2.gb b/.github/actions/oam_bug-2.gb new file mode 100755 index 0000000..a3f55af Binary files /dev/null and b/.github/actions/oam_bug-2.gb differ diff --git a/.github/actions/sanity_tests.sh b/.github/actions/sanity_tests.sh new file mode 100755 index 0000000..26fb398 --- /dev/null +++ b/.github/actions/sanity_tests.sh @@ -0,0 +1,29 @@ +./build/bin/tester/sameboy_tester --jobs 5 \ + --length 40 .github/actions/cgb_sound.gb \ + --length 10 .github/actions/cgb-acid2.gbc \ + --length 10 .github/actions/dmg-acid2.gb \ +--dmg --length 40 .github/actions/dmg_sound-2.gb \ +--dmg --length 20 .github/actions/oam_bug-2.gb + +mv .github/actions/dmg{,-mode}-acid2.bmp + +./build/bin/tester/sameboy_tester \ +--dmg --length 10 .github/actions/dmg-acid2.gb + +FAILED_TESTS=` +shasum .github/actions/*.bmp | grep -E -v \(\ +44ce0c7d49254df0637849c9155080ac7dc3ef3d\ \ .github/actions/cgb-acid2.bmp\|\ +dbcc438dcea13b5d1b80c5cd06bda2592cc5d9e0\ \ .github/actions/cgb_sound.bmp\|\ +0caadf9634e40247ae9c15ff71992e8f77bbf89e\ \ .github/actions/dmg-acid2.bmp\|\ +c50daed36c57a8170ff362042694786676350997\ \ .github/actions/dmg-mode-acid2.bmp\|\ +c9e944b7e01078bdeba1819bc2fa9372b111f52d\ \ .github/actions/dmg_sound-2.bmp\|\ +f0172cc91867d3343fbd113a2bb98100074be0de\ \ .github/actions/oam_bug-2.bmp\ +\)` + +if [ -n "$FAILED_TESTS" ] ; then + echo "Failed the following tests:" + echo $FAILED_TESTS | tr " " "\n" | grep -o -E "[^/]+\.bmp" | sed s/.bmp// | sort + exit 1 +fi + +echo Passed all tests \ No newline at end of file diff --git a/.github/workflows/buildability.yml b/.github/workflows/sanity.yml similarity index 70% rename from .github/workflows/buildability.yml rename to .github/workflows/sanity.yml index 7cd5298..e0ac132 100644 --- a/.github/workflows/buildability.yml +++ b/.github/workflows/sanity.yml @@ -1,4 +1,4 @@ -name: "Bulidability" +name: "Bulidability and Sanity" on: push jobs: @@ -23,7 +23,11 @@ jobs: ./.github/actions/install_deps.sh ${{ matrix.os }} - name: Build run: | - ${{ matrix.cc }} -v; make sdl libretro ${{ matrix.extra_target }} -j CONF=release CC=${{ matrix.cc }} + ${{ matrix.cc }} -v; make sdl tester libretro ${{ matrix.extra_target }} -j CONF=release CC=${{ matrix.cc }} + - name: Sanity tests + shell: bash + run: | + ./.github/actions/sanity_tests.sh - name: Upload binaries uses: actions/upload-artifact@v1 with: