zba/.github/workflows/main.yml

60 lines
1.4 KiB
YAML
Raw Normal View History

2022-11-10 15:58:47 +00:00
name: Nightly
2022-10-31 09:42:43 +00:00
on:
push:
paths:
- "**.zig"
2022-10-31 09:42:43 +00:00
branches:
- main
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
2022-10-31 09:42:43 +00:00
jobs:
build:
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
2022-10-31 09:42:43 +00:00
runs-on: ${{matrix.os}}
steps:
2022-11-11 17:25:56 +00:00
- uses: goto-bus-stop/setup-zig@v2
2022-10-31 09:42:43 +00:00
with:
version: master
- name: prepare-linux
if: runner.os == 'Linux'
run: |
2023-03-11 03:41:27 +00:00
sudo apt update
sudo apt install libgtk-3-dev
sudo apt install libsdl2-dev
2022-10-31 09:42:43 +00:00
- name: prepare-windows
if: runner.os == 'Windows'
run: |
vcpkg integrate install
vcpkg install sdl2:x64-windows
git config --global core.autocrlf false
- name: prepare-macos
if: runner.os == 'macOS'
run: |
brew install sdl2
- uses: actions/checkout@v3
2022-10-31 09:42:43 +00:00
with:
submodules: recursive
2022-10-31 09:42:43 +00:00
- name: build
2023-02-19 05:52:51 +00:00
run: zig build -Doptimize=ReleaseSafe -Dcpu=baseline
2022-10-31 09:42:43 +00:00
- name: upload
uses: actions/upload-artifact@v3
with:
name: zba-${{matrix.os}}
path: zig-out/bin
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-10-31 09:42:43 +00:00
with:
submodules: recursive
2022-11-11 17:25:56 +00:00
- uses: goto-bus-stop/setup-zig@v2
2022-10-31 09:42:43 +00:00
with:
version: master
- run: zig fmt src/**/*.zig