mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Add Windows testing
This commit is contained in:
17
.github/actions/mingw-configure.sh
vendored
Normal file
17
.github/actions/mingw-configure.sh
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source mingw-env @TRIPLE@
|
||||||
|
echo LAST IS: $last
|
||||||
|
|
||||||
|
# check if last arg is a path to configure, else use parent
|
||||||
|
for last; do true; done
|
||||||
|
if test -x "${last}/configure"; then
|
||||||
|
config_path="$last"
|
||||||
|
else
|
||||||
|
config_path=".."
|
||||||
|
fi
|
||||||
|
|
||||||
|
${config_path}/configure \
|
||||||
|
--host=@TRIPLE@ --target=@TRIPLE@ --build="$CHOST" \
|
||||||
|
--prefix=/usr/@TRIPLE@ --libdir=/usr/@TRIPLE@/lib --includedir=/usr/@TRIPLE@/include \
|
||||||
|
--enable-shared --enable-static "$@"
|
||||||
16
.github/actions/mingw-env.sh
vendored
Normal file
16
.github/actions/mingw-env.sh
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
_arch=$1
|
||||||
|
|
||||||
|
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
|
||||||
|
default_mingw_compiler_flags="$default_mingw_pp_flags -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
|
||||||
|
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed -fstack-protector"
|
||||||
|
|
||||||
|
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
|
||||||
|
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
|
||||||
|
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
|
||||||
|
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
|
||||||
|
|
||||||
|
mingw_prefix=/usr/${_arch}
|
||||||
|
export PKG_CONFIG_SYSROOT_DIR="${mingw_prefix}"
|
||||||
|
export PKG_CONFIG_LIBDIR="${mingw_prefix}/lib/pkgconfig:${mingw_prefix}/share/pkgconfig"
|
||||||
44
.github/actions/mingw-w64-libpng-dev.sh
vendored
Executable file
44
.github/actions/mingw-w64-libpng-dev.sh
vendored
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# This script was written by ISSOtm while looking at Arch Linux's PKGBUILD for
|
||||||
|
# the corresponding package. (And its dependencies)
|
||||||
|
# https://aur.archlinux.org/packages/mingw-w64-libpng/
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pngver=1.6.37
|
||||||
|
_apngver=$pngver
|
||||||
|
_arch="$1"
|
||||||
|
|
||||||
|
|
||||||
|
## Install mingw-configure and mingw-env (both build dependencies)
|
||||||
|
|
||||||
|
install -m 755 .github/actions/mingw-env.sh /usr/bin/mingw-env
|
||||||
|
|
||||||
|
sed "s|@TRIPLE@|${_arch}|g" .github/actions/mingw-configure.sh > ${_arch}-configure
|
||||||
|
install -m 755 ${_arch}-configure /usr/bin/
|
||||||
|
|
||||||
|
|
||||||
|
## Grab sources and check them
|
||||||
|
|
||||||
|
wget http://downloads.sourceforge.net/sourceforge/libpng/libpng-$pngver.tar.xz
|
||||||
|
wget http://downloads.sourceforge.net/project/apng/libpng/libpng16/libpng-$_apngver-apng.patch.gz
|
||||||
|
sha256sum -c .github/actions/mingw-w64-libpng-dev.sha256sums
|
||||||
|
|
||||||
|
## Extract sources
|
||||||
|
|
||||||
|
tar -xf libpng-$pngver.tar.xz
|
||||||
|
gunzip libpng-$_apngver-apng.patch.gz
|
||||||
|
|
||||||
|
|
||||||
|
## Start building!
|
||||||
|
|
||||||
|
cd libpng-$pngver
|
||||||
|
# Patch in apng support
|
||||||
|
patch -p0 ../libpng-$_apngver-apng.patch
|
||||||
|
|
||||||
|
mkdir -p build-${_arch}
|
||||||
|
cd build-${_arch}
|
||||||
|
${_arch}-configure LDFLAGS=-static-libgcc
|
||||||
|
make
|
||||||
|
make install
|
||||||
2
.github/actions/mingw-w64-libpng-dev.sha256sums
vendored
Normal file
2
.github/actions/mingw-w64-libpng-dev.sha256sums
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
10d9e0cb60e2b387a79b355eb7527c0bee2ed8cbd12cf04417cabc4d6976683c libpng-1.6.37-apng.patch.gz
|
||||||
|
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca libpng-1.6.37.tar.xz
|
||||||
91
.github/workflows/testing.yml
vendored
91
.github/workflows/testing.yml
vendored
@@ -26,16 +26,97 @@ jobs:
|
|||||||
sudo make install -j Q=
|
sudo make install -j Q=
|
||||||
- name: Package binaries
|
- name: Package binaries
|
||||||
run: |
|
run: |
|
||||||
mkdir $DIST_DIR
|
mkdir bins
|
||||||
cp rgb{asm,link,fix,gfx} $DIST_DIR
|
cp rgb{asm,link,fix,gfx} bins
|
||||||
env:
|
|
||||||
DIST_DIR: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-bins
|
|
||||||
- name: Upload binaries
|
- name: Upload binaries
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-bins
|
name: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-bins
|
||||||
path: rgbds-canary-${{ matrix.os }}-${{ matrix.cc }}-bins
|
path: bins
|
||||||
- name: Test
|
- name: Test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
test/run-tests.sh
|
test/run-tests.sh
|
||||||
|
|
||||||
|
windows-build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
bits: [32, 64]
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
include:
|
||||||
|
- bits: 32
|
||||||
|
arch: i686
|
||||||
|
triplet: i686-w64-mingw32
|
||||||
|
- bits: 64
|
||||||
|
arch: x86-64
|
||||||
|
triplet: x86_64-w64-mingw32
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
env:
|
||||||
|
DIST_DIR: win${{ matrix.bits }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install deps
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
./.github/actions/install_deps.sh ${{ matrix.os }}
|
||||||
|
- name: Install MinGW
|
||||||
|
run: |
|
||||||
|
sudo apt-get install gcc-mingw-w64-${{ matrix.arch }} mingw-w64-tools libz-mingw-w64-dev
|
||||||
|
- name: Install libpng dev headers for MinGW
|
||||||
|
run: |
|
||||||
|
sudo ./.github/actions/mingw-w64-libpng-dev.sh ${{ matrix.triplet }}
|
||||||
|
- name: Build Windows binaries
|
||||||
|
run: |
|
||||||
|
make mingw${{ matrix.bits }} -j Q=
|
||||||
|
- name: Package binaries
|
||||||
|
run: |
|
||||||
|
mkdir bins
|
||||||
|
mv rgbasm bins/rgbasm.exe
|
||||||
|
mv rgblink bins/rgblink.exe
|
||||||
|
mv rgbfix bins/rgbfix.exe
|
||||||
|
mv rgbgfx bins/rgbgfx.exe
|
||||||
|
cp /usr/${{ matrix.triplet }}/lib/zlib1.dll bins
|
||||||
|
cp /usr/${{ matrix.triplet }}/bin/libpng16-16.dll bins
|
||||||
|
- name: Upload Windows binaries
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: bins${{ matrix.bits }}
|
||||||
|
path: bins
|
||||||
|
|
||||||
|
windows-testing:
|
||||||
|
needs: windows-build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
bits: [32, 64]
|
||||||
|
include:
|
||||||
|
- bits: 32
|
||||||
|
rgbgfx_fail: true
|
||||||
|
- bits: 64
|
||||||
|
rgbgfx_fail: false
|
||||||
|
runs-on: windows-2019
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Retrieve binaries
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: bins${{ matrix.bits }}
|
||||||
|
path: bins
|
||||||
|
- name: Extract binaries
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cp bins/* .
|
||||||
|
- name: Run tests
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
test/run-tests.sh
|
||||||
|
if: matrix.rgbgfx_fail == false
|
||||||
|
- name: Run tests (without RGBGFX)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pushd test/asm
|
||||||
|
./test.sh
|
||||||
|
popd
|
||||||
|
pushd test/link
|
||||||
|
./test.sh
|
||||||
|
popd
|
||||||
|
if: matrix.rgbgfx_fail == true
|
||||||
|
|||||||
Reference in New Issue
Block a user