fix: keep up with zig master #295
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: | |
workflow_dispatch: | |
schedule: | |
- cron: '10 20 * * *' | |
pull_request: | |
paths: | |
- "**.zig" | |
- ".github/**" | |
push: | |
branches: | |
- main | |
paths: | |
- "**.zig" | |
- ".github/**" | |
jobs: | |
examples: | |
timeout-minutes: 10 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
zig: [0.11.0, master] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: ${{ matrix.zig }} | |
- name: Start services | |
uses: ikalnytskyi/action-setup-postgres@v4 | |
with: | |
username: postgres | |
password: postgres | |
database: postgres | |
port: 5432 | |
- name: mysql for ubuntu | |
uses: mirromutth/mysql-action@v1.1 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
character set server: 'utf8' | |
collation server: 'utf8_general_ci' | |
mysql version: '8.0' | |
mysql database: 'public' | |
mysql root password: 'password' | |
mysql user: 'developer' | |
- name: mysql for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
node .github/ci.js | |
- name: Install deps | |
run: | | |
make install-deps | |
- name: Set pkg-config(macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
prefix=$(brew --prefix) | |
echo "PKG_CONFIG_PATH=${prefix}/opt/libpq/lib/pkgconfig:${prefix}/opt/mysql-client/lib/pkgconfig" >> ${GITHUB_ENV} | |
- name: Hack | |
if: matrix.zig == '0.11.0' | |
run: | | |
# 0.11.0 will report following error with zon file, so delete now. | |
# error: TarUnsupportedFileType | |
rm build.zig.zon | |
- name: Run examples(Unix) | |
if: matrix.os != 'windows-latest' | |
run: | | |
pkg-config --libs --cflags libpq mysqlclient | |
zig fmt --check src/ | |
zig build | |
zig build run-all --summary all | |
- name: Run examples(Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
zig.exe fmt --check src/ | |
zig.exe build | |
zig.exe build run-all --summary all |