2022-10-31 10:30:43 +00:00
|
|
|
on: [push, workflow_dispatch]
|
2022-10-31 09:42:43 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-10-31 10:36:47 +00:00
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2022-10-31 09:42:43 +00:00
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
steps:
|
|
|
|
- uses: goto-bus-stop/setup-zig@v1
|
2022-10-31 10:01:18 +00:00
|
|
|
with:
|
|
|
|
version: master
|
2022-10-31 09:42:43 +00:00
|
|
|
- name: prepare-linux
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libsdl2-dev
|
2022-10-31 10:14:44 +00:00
|
|
|
- name: prepare-windows
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
run: |
|
2022-10-31 10:30:43 +00:00
|
|
|
vcpkg integrate install
|
2022-10-31 10:14:44 +00:00
|
|
|
vcpkg install sdl2:x64-windows
|
2022-10-31 10:39:54 +00:00
|
|
|
git config --global core.autocrlf false
|
2022-10-31 10:36:47 +00:00
|
|
|
- name: prepare-macos
|
|
|
|
if: runner.os == 'macOS'
|
|
|
|
run: |
|
|
|
|
brew install sdl2
|
2022-10-31 10:39:54 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: true
|
2022-10-31 09:42:43 +00:00
|
|
|
- name: build
|
|
|
|
run: zig build -Drelease-safe
|
2022-10-31 10:49:17 +00:00
|
|
|
- name: upload
|
|
|
|
uses: actions/upload-artifacts@v2
|
|
|
|
with:
|
|
|
|
name: build-${{matrix.os}}
|
|
|
|
path: zig-out/bin
|
2022-10-31 09:42:43 +00:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-10-31 10:01:18 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
2022-10-31 09:42:43 +00:00
|
|
|
- uses: goto-bus-stop/setup-zig@v1
|
2022-10-31 10:01:18 +00:00
|
|
|
with:
|
|
|
|
version: master
|
2022-10-31 09:42:43 +00:00
|
|
|
- run: zig fmt src/**/*.zig
|
|
|
|
|