Skip to content

Commit

Permalink
try windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat committed Jul 28, 2024
1 parent 94bff0e commit dd7b09d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 46 deletions.
37 changes: 4 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

jobs:
build:
runs-on: ubuntu-latest
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -14,31 +14,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
# - uses: schmiddim/action-wget-unzip@v2
# with:
# url: "https://github.com/gbdk-2020/gbdk-2020/releases/download/4.3.0/gbdk-linux64.tar.gz"
# destination: gbdk
- uses: robinraju/release-downloader@v1
with:
repository: "gbdk-2020/gbdk-2020"
tag: "4.3.0"
fileName: "gbdk-linux64.tar.gz"
extract: true
tarBall: true
- uses: pyvista/setup-headless-display-action@v2
- name: Install wine
run: |
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo apt update
sudo apt install -y --install-recommends winehq-stable winbind
wine --version
- name: Install wine-mono
run: |
wget https://github.com/madewokherd/wine-mono/releases/download/wine-mono-9.0.0/wine-mono-9.0.0-x86.msi
WINEDEBUG=fixme-all WINEDLLOVERRIDES=mscoree=d wine wine-mono-9.0.0-x86.msi
- name: Get BGB
uses: schmiddim/action-wget-unzip@v2
with:
Expand All @@ -48,19 +30,8 @@ jobs:
run: |
cd tests
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with Ruff
# run: |
# cd tests
# pip install ruff
# ruff check --format=github --target-version=py310 .
# continue-on-error: true
- name: Run wine
pip install -r requirements.txt
- name: Test with pytest
run: |
cd tests
wine ../bgb/bgb.exe -set \"DebugSrcBrk=1\" -hf -stateonexit -screenonexit build/wav_test_load_and_play.bmp build/wav_test_load_and_play.gb
ls -alF
# - name: Test with pytest
# run: |
# cd tests
# pytest -v -s
pytest -v -s
22 changes: 9 additions & 13 deletions tests/bgb_get_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,36 @@ def make_and_run(rom_relative):
rom_path_full = base_path.joinpath(rom_relative)
screenshot_path = rom_path_full.with_suffix('.bmp')

subprocess.run([
"/usr/bin/env",
"wine",
result = subprocess.call([
"../bgb/bgb64.exe",
"-set \"DebugSrcBrk=1\"",
"-hf",
"-stateonexit",
"-screenonexit",
screenshot_path,

"-screenonexit", screenshot_path,
rom_relative,
],
cwd=base_dir,
# stdout=subprocess.DEVNULL,
# stderr=subprocess.DEVNULL,
)

if result != 0:
raise Exception("Rom execution failed " + rom_relative)

if not rom_path_full.with_suffix(".sna").is_file():
raise Exception("Tried to run rom, failed " + rom_relative)
raise Exception(
"Snapshot not found after execution " + rom_relative)


def make_rom(rom_relative):
result = subprocess.call(
[
"/usr/bin/env",
"make",
rom_relative
],
["make", rom_relative],
cwd=base_dir,
# stdout=subprocess.DEVNULL
)

if result != 0:
raise Exception("Tried to make rom, failed " + rom_relative)
raise Exception("Rom make failed " + rom_relative)


# The following code is repurposed from unit_checker.py by untoxa (MIT License)
Expand Down

0 comments on commit dd7b09d

Please sign in to comment.