Continuous Build #1757
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Build | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: '0 5 * * *' # run at 5 AM UTC | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsdl2-dev libsdl2-image-dev libwebp-dev | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: SDL version | |
run: sdl2-config --version | |
- name: Build Example | |
run: zig build install | |
# Skipped on Ubuntu as it doesn't have SDL2.0.18 yet | |
# - name: Run tests | |
# run: zig build test | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install dependencies | |
run: brew install sdl2 sdl2_image sdl2_ttf harfbuzz graphite2 | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: Build Examples | |
run: zig build install | |
- name: Run tests | |
run: zig build test | |
build-windows-dynamic: | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ | |
x86-windows-gnu, | |
x86_64-windows-gnu, | |
# x86-windows-msvc, # disabled for now as it seems like zig detects the wrong files | |
x86_64-windows-msvc, | |
] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: Install VisualStudio (x86) | |
if: ${{ matrix.target == 'x86-windows-msvc' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
uwp: false | |
arch: amd64_x86 # cross-compile from amd64 to x86 | |
- name: Install VisualStudio (x64) | |
if: ${{ matrix.target == 'x86_64-windows-msvc' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
uwp: false | |
arch: x64 | |
- name: Download SDL2 (MinGW) | |
uses: carlosperate/[email protected] | |
if: ${{ matrix.target == 'x86-windows-gnu' || matrix.target == 'x86_64-windows-gnu' }} | |
with: | |
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz | |
file-name: SDL2.tar.gz | |
location: . | |
- name: Download SDL2 (Visual Studio) | |
uses: carlosperate/[email protected] | |
if: ${{ matrix.target == 'x86-windows-msvc' || matrix.target == 'x86_64-windows-msvc' }} | |
with: | |
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip | |
file-name: SDL2.tar.gz | |
location: . | |
- name: Extract SDL2 | |
uses: brunoborges/justextract@v1 | |
with: | |
file: SDL2.tar.gz | |
- name: Create SDK file | |
uses: DamianReeves/[email protected] | |
with: | |
path: .build_config/sdl.json | |
contents: | | |
{ | |
"x86-windows-gnu": { | |
"include": "SDL2-2.0.18/i686-w64-mingw32/include", | |
"libs": "SDL2-2.0.18/i686-w64-mingw32/lib", | |
"bin": "SDL2-2.0.18/i686-w64-mingw32/bin" | |
}, | |
"x86_64-windows-gnu": { | |
"include": "SDL2-2.0.18/x86_64-w64-mingw32/include", | |
"libs": "SDL2-2.0.18/x86_64-w64-mingw32/lib", | |
"bin": "SDL2-2.0.18/x86_64-w64-mingw32/bin" | |
}, | |
"x86-windows-msvc": { | |
"include": "SDL2-2.0.18/include", | |
"libs": "SDL2-2.0.18/lib/x86", | |
"bin": "SDL2-2.0.18/lib/x86" | |
}, | |
"x86_64-windows-msvc": { | |
"include": "SDL2-2.0.18/include", | |
"libs": "SDL2-2.0.18/lib/x64", | |
"bin": "SDL2-2.0.18/lib/x64" | |
} | |
} | |
write-mode: overwrite | |
- name: Build | |
run: zig build -Dtarget=${{matrix.target}} -Dlink=dynamic | |
build-windows-static: | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86-windows-gnu, x86_64-windows-gnu] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: Download SDL2 (MinGW) | |
uses: carlosperate/[email protected] | |
with: | |
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz | |
file-name: SDL2.tar.gz | |
location: . | |
- name: Extract SDL2 | |
uses: brunoborges/justextract@v1 | |
with: | |
file: SDL2.tar.gz | |
- name: Create SDK file | |
uses: DamianReeves/[email protected] | |
with: | |
path: .build_config/sdl.json | |
contents: | | |
{ | |
"x86-windows-gnu": { | |
"include": "SDL2-2.0.18/i686-w64-mingw32/include", | |
"libs": "SDL2-2.0.18/i686-w64-mingw32/lib", | |
"bin": "SDL2-2.0.18/i686-w64-mingw32/bin" | |
}, | |
"x86_64-windows-gnu": { | |
"include": "SDL2-2.0.18/x86_64-w64-mingw32/include", | |
"libs": "SDL2-2.0.18/x86_64-w64-mingw32/lib", | |
"bin": "SDL2-2.0.18/x86_64-w64-mingw32/bin" | |
} | |
} | |
write-mode: overwrite | |
- name: Build | |
run: zig build -Dtarget=${{matrix.target}} -Dlink=static | |
build-cross-windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
host: [ubuntu-latest, macos-latest] | |
target: [x86-windows-gnu, x86_64-windows-gnu] | |
linkage: [static, dynamic] | |
runs-on: ${{matrix.host}} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: Download SDL2 (MinGW) | |
uses: carlosperate/[email protected] | |
with: | |
file-url: https://www.libsdl.org/release/SDL2-devel-2.0.18-mingw.tar.gz | |
file-name: SDL2.tar.gz | |
location: . | |
- name: Extract SDL2 | |
uses: brunoborges/justextract@v1 | |
with: | |
file: SDL2.tar.gz | |
- name: Create SDK file | |
uses: DamianReeves/[email protected] | |
with: | |
path: .build_config/sdl.json | |
contents: | | |
{ | |
"x86-windows-gnu": { | |
"include": "SDL2-2.0.18/i686-w64-mingw32/include", | |
"libs": "SDL2-2.0.18/i686-w64-mingw32/lib", | |
"bin": "SDL2-2.0.18/i686-w64-mingw32/bin" | |
}, | |
"x86_64-windows-gnu": { | |
"include": "SDL2-2.0.18/x86_64-w64-mingw32/include", | |
"libs": "SDL2-2.0.18/x86_64-w64-mingw32/lib", | |
"bin": "SDL2-2.0.18/x86_64-w64-mingw32/bin" | |
} | |
} | |
write-mode: overwrite | |
- name: Build | |
run: zig build -Dskip-test -Dtarget=${{matrix.target}} -Dlink=${{matrix.linkage}} | |
build-cross-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
host: [ubuntu-latest, macos-latest, windows-latest] | |
target: [x86_64-linux-gnu, aarch64-linux-gnu] | |
runs-on: ${{matrix.host}} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: Build | |
run: zig build -Dskip-test -Dtarget=${{matrix.target}} --verbose | |
# This would not be a cross-compilation process, thus we must skip it | |
if: ${{ matrix.host != 'ubuntu-latest' && matrix.target == 'x86_64-linux-gnu' }} |