Skip to content

Commit

Permalink
fix zig target
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed May 15, 2024
1 parent 141ec12 commit 13971db
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # macos-latest is macos-14, which is arm runner
os: [ubuntu-latest, macos-latest]
zig: [0.12.0, master]
steps:
- uses: actions/checkout@v4
Expand All @@ -46,34 +46,26 @@ jobs:
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)
- name: mysql for macOS
if: matrix.os == 'macos-latest'
run: |
node .github/ci.js
prefix=$(brew --prefix)
echo "PKG_CONFIG_PATH=${prefix}/opt/sqlite/lib/pkgconfig:${prefix}/opt/libpq/lib/pkgconfig:${prefix}/opt/mysql-client/lib/pkgconfig" >> ${GITHUB_ENV}
- name: Run examples(Unix)
if: matrix.os == 'ubuntu-latest'
run: |
TARGET="aarch64-macos"
if [ `uname -S` = "Linux" ]; then
TARGET="x86_64-linux"
fi
pkg-config --libs --cflags libpq mysqlclient
zig fmt --check src/
zig build
zig build run-all --summary all
- name: Run examples(macOS)
if: matrix.os == 'macos-latest'
run: |
pkg-config --libs --cflags libpq mysqlclient
zig fmt --check src/
zig build -Dtarget=aarch64-macos
zig build run-all -Dtarget=aarch64-macos --summary all
zig build -Dtarget="${TARGET}"
zig build run-all -Dtarget="${TARGET}" --summary all
- name: Run examples(Windows)
if: matrix.os == 'windows-latest'
Expand Down

0 comments on commit 13971db

Please sign in to comment.