Skip to content

Add where clause to expand query for policies (#55) #261

Add where clause to expand query for policies (#55)

Add where clause to expand query for policies (#55) #261

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
linux:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow_ref }}-${{ github.job }}_${{ matrix.container }}-${{ matrix.compiler }}
container: ${{ matrix.container }}
services:
postgres:
env:
POSTGRES_DB: test-gatekeeper
POSTGRES_PASSWORD: gatekeeper
POSTGRES_USER: gatekeeper
image: postgres:15
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7-alpine
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
compiler:
- g++
- clang++
container:
- ubuntu:23.04
include:
- compiler: g++
dependencies: g++
- compiler: clang++
dependencies: clang libclang-rt-dev
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
${{ matrix.dependencies }} \
cmake ninja-build \
libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc \
libpq-dev postgresql-client
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.arch }}_${{ matrix.container }}-${{ matrix.compiler }}-${{ hashFiles('cmake/dependencies.cmake') }}
- name: Setup Postgres
run: psql < datastore/schema.sql
env:
PGDATABASE: test-gatekeeper
PGHOST: postgres
PGPASSWORD: gatekeeper
PGUSER: gatekeeper
- name: Configure CMake
run: |
cmake -B .build -G Ninja -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=Release -DGATEKEEPER_ENABLE_TESTING=ON
- name: Build
run: |
cmake --build .build --config Release
- name: Test
working-directory: ${{ github.workspace }}/.build
run: |
ctest -C Release --exclude-regex redis.concurrency --output-on-failure
env:
PGDATABASE: test-gatekeeper
PGHOST: postgres
PGPASSWORD: gatekeeper
PGUSER: gatekeeper
REDIS_HOST: redis
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
macos:
runs-on: macos-latest
concurrency:
group: ${{ github.workflow_ref }}-${{ github.job }}_${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
compiler:
- g++
- clang++
steps:
- name: Install dependencies
run: |
brew install \
abseil c-ares protobuf@3 re2 \
ninja \
redis
brew link protobuf@3
- name: Start services
run: |
brew services start postgresql
brew services start redis
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.arch }}_${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('cmake/dependencies.cmake') }}
- name: Setup Postgres
run: |
psql --dbname=postgres -c "create user gatekeeper with password 'gatekeeper';"
psql --dbname=postgres -c 'create database "test-gatekeeper" owner gatekeeper;'
psql --dbname=test-gatekeeper --host=localhost --username=gatekeeper < datastore/schema.sql
env:
PGPASSWORD: gatekeeper
- name: Configure CMake
run: |
cmake -B .build -G Ninja \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DCMAKE_BUILD_TYPE=Release \
-DGATEKEEPER_ENABLE_TESTING=ON \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
- name: Build
run: |
cmake --build .build --config Release
- name: Test
working-directory: ${{ github.workspace }}/.build
run: |
ctest -C Release --exclude-regex redis.concurrency --output-on-failure
env:
PGDATABASE: test-gatekeeper
PGHOST: localhost
PGPASSWORD: gatekeeper
PGUSER: gatekeeper