Something went wrong. Try again.
Native PostgreSQL driver / client for Zig
Something went wrong. Try again.
YAML
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071name: ci
on: push: branches: [master, dev] pull_request:
env: ZIG_VERSION: "0.16.0"
jobs: # No database needed: formatting, plus a compile of every build-config # permutation and the example. `zig build test` only ever compiles # openssl=true/column_names=false and never touches example/, so this is what # keeps those paths from rotting. check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: install openssl run: sudo apt-get update && sudo apt-get install -y libssl-dev
- name: install zig run: | curl -sSL "https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-linux-${ZIG_VERSION}.tar.xz" | tar -xJ echo "$PWD/zig-x86_64-linux-${ZIG_VERSION}" >> "$GITHUB_PATH"
# zig fmt walks zig-pkg/, so list paths explicitly rather than using `.` - name: check formatting run: zig fmt --check build.zig build.zig.zon src test_runner.zig example
- name: compile all permutations + example run: zig build check -Dopenssl_lib_name=ssl
test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: install openssl run: sudo apt-get update && sudo apt-get install -y libssl-dev
- name: install zig run: | curl -sSL "https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-linux-${ZIG_VERSION}.tar.xz" | tar -xJ echo "$PWD/zig-x86_64-linux-${ZIG_VERSION}" >> "$GITHUB_PATH"
# server.crt/server.key are gitignored, so a fresh clone has no server # certificate and the TLS tests cannot pass without this. - name: generate test certificates run: make ssl
- name: start postgres run: docker compose -f tests/compose.yml up -d
- name: wait for postgres run: | for _ in $(seq 1 60); do if docker compose -f tests/compose.yml exec -T postgres pg_isready -U postgres; then exit 0 fi sleep 2 done echo "postgres never became ready" docker compose -f tests/compose.yml logs exit 1
- name: run tests run: zig build test -Dopenssl_lib_name=ssl