CI #96
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: CI | |
on: | |
schedule: | |
- cron: '10 20 * * *' | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '**.zig' | |
- '**.yml' | |
push: | |
branches: | |
- main | |
paths: | |
- '**.zig' | |
- '**.yml' | |
jobs: | |
test-linux: | |
timeout-minutes: 10 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
zig-version: [master, 0.12.0] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: ${{ matrix.zig-version }} | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Run tests | |
run: | | |
make test | |
- name: Run examples | |
run: | | |
SERVER=/tmp/echo-server | |
go build -o ${SERVER} server/main.go | |
${SERVER} & | |
sleep 10 | |
make run | |
- name: Install deps | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt update && sudo apt install -y valgrind | |
- name: Memory leak detect | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
zig build -Dcpu=baseline --verbose | |
BINS=("./zig-out/bin/basic" "./zig-out/bin/advanced") | |
for bin in ${BINS[@]}; do | |
valgrind --leak-check=full --tool=memcheck \ | |
--show-leak-kinds=all --error-exitcode=1 ${bin} | |
done |