Skip to content

Setup tests in the CI #2

Setup tests in the CI

Setup tests in the CI #2

Workflow file for this run

name: Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v3
- name: Login to GitHub Container Registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build libpq
run: bazel build //:libpq
- name: Test C program
run: |
docker run --rm -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:16.2-alpine &&
while !</dev/tcp/db/5432; do sleep 1; done &&
gcc examples/c/main.c -o main -l:bazel-bin/libpq.a &&
./main