Skip to content

Merge pull request #38 #200

Merge pull request #38

Merge pull request #38 #200

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
coverage:
name: Code coverage
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow_ref }}-${{ github.job }}
container: ubuntu:23.04
services:
postgres:
env:
POSTGRES_DB: test-gatekeeper
POSTGRES_PASSWORD: gatekeeper
POSTGRES_USER: gatekeeper
image: postgres:14
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
steps:
- name: Install dependencies
run: |
apt update
apt install -y --no-install-recommends \
clang cmake libclang-rt-dev make ninja-build \
libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc \
libpq-dev postgresql-client \
lcov llvm
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.arch }}_${{ github.job }}-${{ hashFiles('cmake/dependencies.cmake') }}
- name: Setup Postgres
run: psql < datastore/schema.sql
env:
PGDATABASE: test-gatekeeper
PGHOST: postgres
PGPASSWORD: gatekeeper
PGUSER: gatekeeper
- name: Build
run: make
- name: Generate code coverage reports
run: make coverage:lcov
env:
PGDATABASE: test-gatekeeper
PGHOST: postgres
PGPASSWORD: gatekeeper
PGUSER: gatekeeper
REDIS_HOST: redis
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ${{ github.workspace }}/.build
fail_ci_if_error: true
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make lint:ci