Skip to content

Update GitHub workflows #500

Update GitHub workflows

Update GitHub workflows #500

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:24.04
services:
postgres:
env:
POSTGRES_DB: test-ruek
POSTGRES_PASSWORD: ruek
POSTGRES_USER: ruek
image: postgres:15
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
steps:
- name: Install dependencies
run: |
apt update
apt install -y --no-install-recommends \
clang cmake libclang-rt-dev make ninja-build \
git ca-certificates \
libprotobuf-dev libprotoc-dev protobuf-compiler \
libpq-dev postgresql-client \
lcov llvm
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .build
key: ${{ runner.arch }}_${{ github.job }}-${{ hashFiles('cmake/dependencies.cmake') }}
- name: Setup Postgres
run: psql < db/schema.sql
env:
PGDATABASE: test-ruek
PGHOST: postgres
PGPASSWORD: ruek
PGUSER: ruek
- name: Build
run: make
- name: Generate code coverage reports
run: make coverage:lcov
env:
PGDATABASE: test-ruek
PGHOST: postgres
PGPASSWORD: ruek
PGUSER: ruek
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
directory: ${{ github.workspace }}/.build
fail_ci_if_error: true
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
container: ubuntu:24.04
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
clang-format make
- uses: actions/checkout@v4
- run: make lint:ci