IntegratedQuantum b303244773
Run the zon format check with our zig fmt (#1175)
* Format all the zon assets to prepare for running the the format check with our zig fmt

* Update ci.yml

* Remove zon files from the old formatter

* Add a formatting violation to test the CI

* Undo the check
2025-03-07 22:34:55 +01:00

35 lines
1.4 KiB
YAML

# This is a basic workflow that is manually triggered
name: Compilation and Format Check
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
compile:
runs-on: ubuntu-latest
name: Compilation Check
steps:
- uses: actions/checkout@v3
- uses: mlugg/setup-zig@v1
with:
version: 0.14.0
- run: sudo apt install libgl-dev libasound2-dev libx11-dev
- run: wget -O /opt/hostedtoolcache/zig/0.14.0/x64/lib/std/zig/render.zig https://github.com/PixelGuys/Cubyz-std-lib/releases/download/0.14.0/render.zig
- run: zig build
- run: zig build -Dtarget=x86_64-windows-gnu
- run: zig build format --summary none
- run: |
if zig build fmt -- *.zig src/*.zig src/*/*.zig src/*/*/*.zig src/*/*/*/*.zig src/*/*/*/*/*.zig src/*/*/*/*/*/*.zig src/*/*/*/*/*/*/*.zig src/*/*/*/*/*/*/*/*.zig src/*/*/*/*/*/*/*/*/*.zig src/*/*/*/*/*/*/*/*/*/*.zig | grep -q . ; then
git diff --color=always;
exit 1;
fi
- run: |
if zig build fmt -- --zon *.zon assets/*.zon assets/*/*.zon assets/*/*/*.zon assets/*/*/*/*.zon assets/*/*/*/*/*.zon assets/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*/*/*/*.zon | grep -q . ; then
git diff --color=always;
exit 1;
fi