Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 43 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@ on:
- main
pull_request:

env:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy from rgbds-live instead installing with

    mkdir $HOME/emsdk
    git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
    $HOME/emsdk/emsdk update-tags
    $HOME/emsdk/emsdk install tot
    $HOME/emsdk/emsdk activate tot

we can use mymindstorm/setup-emsdk@v14 ... it will setup the path ans stuff

EM_VERSION: 4.0.8
EM_CACHE_FOLDER: 'emsdk-cache'

jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
submodules: true

- name: install packages (linux)
run: |
sudo apt-get update
Expand All @@ -38,7 +42,7 @@ jobs:
if: matrix.os == 'windows-latest'

- name: download sdl2 (windows)
uses: albin-johansson/download-sdl2@v1
uses: albin-johansson/download-sdl2@v2
with:
version: 2.0.14
sources_destination: .
Expand All @@ -65,35 +69,46 @@ jobs:
python scripts/tester.py -vv --exe bin/binjgb-tester
if: matrix.os != 'windows-latest'

build-wasm:
name: build-wasm
build-wasm-variants:
name: build-${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [wasm, rgbds-live, gbstudio]
include:
- target: wasm
cmake_flags: ""
- target: rgbds-live
cmake_flags: '-DWERROR=ON -DRGBDS_LIVE=ON -DCMAKE_C_FLAGS="-DBREAKPOINTS_MAX_BANKS_NUMBER=256"'
- target: gbstudio
cmake_flags: "-DWERROR=ON -DGBSTUDIO=ON"

steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: actions/checkout@v4
with:
submodules: true

- name: install packages
run: sudo apt-get install ninja-build
- name: install packages
run: sudo apt-get install ninja-build

- name: emsdk install
run: |
mkdir $HOME/emsdk
git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
$HOME/emsdk/emsdk update-tags
$HOME/emsdk/emsdk install tot
$HOME/emsdk/emsdk activate tot
- name: setup cache
uses: actions/cache@v4
with:
path: ${{ env.EM_CACHE_FOLDER }}
key: ${{ env.EM_VERSION }}-${{ runner.os }}

- name: update path
run: echo "PATH=$PATH:$HOME/emsdk" >> $GITHUB_ENV
- name: emsdk install
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}

- name: mkdir
run: mkdir -p out
- name: mkdir
run: mkdir -p out

- name: cmake
run: cmake -S . -B out -G Ninja -DCMAKE_TOOLCHAIN_FILE=$HOME/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release -DWASM=true
- name: cmake
run: emcmake cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DWASM=true ${{ matrix.cmake_flags }}

- name: build
run: |
source $HOME/emsdk/emsdk_env.sh
cmake --build out
- name: build
run: emmake cmake --build out
2 changes: 1 addition & 1 deletion scripts/build_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def BuildWlaGb():
Run('cmake', '-G', 'NMake Makefiles', '-DCMAKE_BUILD_TYPE=Release', WLA_DX_DIR, cwd=WLA_DX_BUILD_DIR)
Run('nmake', cwd=WLA_DX_BUILD_DIR)
else:
Run('cmake', WLA_DX_DIR, cwd=WLA_DX_BUILD_DIR)
Run('cmake', '-DCMAKE_POLICY_VERSION_MINIMUM=3.5', '-DCMAKE_C_FLAGS=-Wno-strict-prototypes', WLA_DX_DIR, cwd=WLA_DX_BUILD_DIR)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WLA_DX is using cmake minimum veriosn 2.8 or somethig ... also without no-strict-prototypes build fails

Run('make', cwd=WLA_DX_BUILD_DIR)
# Test that wla-gb was build OK.
Run(os.path.join(WLA_DX_BIN_DIR, 'wla-gb'))
Expand Down
Loading