Check for existing db migration file #177
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test C | |
on: | |
push: | |
branches: [ main, stable ] | |
pull_request: | |
branches: [ main, stable ] | |
jobs: | |
build_and_test_debug: | |
name: Build and test | |
runs-on: ubuntu-latest | |
container: greenbone/gvm-libs:oldstable | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install build dependencies | |
run: .github/workflows/install-build-dependencies.sh | |
- name: Set up database | |
run: | | |
su postgres -c " \ | |
/etc/init.d/postgresql start && \ | |
createuser -DRS root && \ | |
createdb -O root gvmd && \ | |
psql -d gvmd -c 'create role dba with superuser noinherit; grant dba to root;' && \ | |
psql -d gvmd -c 'create extension \"uuid-ossp\"; create extension \"pgcrypto\"; create extension "pgtap";' && \ | |
/etc/init.d/postgresql stop \ | |
" | |
- name: Build and install extension | |
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make install | |
- name: Start PostgreSQL server | |
run: su postgres -c "pg_ctlcluster 13 main start" | |
- name: Add "/usr/local/lib" as ld directory | |
run: echo "/usr/local/lib" >> /etc/ld.so.conf.d/gvm.conf && ldconfig | |
- name: Add pg-gvm extension | |
run: psql -d gvmd -c 'SET ROLE dba; CREATE EXTENSION "pg-gvm";' | |
- name: Create gvmd tables | |
run: psql -d gvmd < gvmd-tables.sql | |
- name: Run tests | |
run: pg_prove -d gvmd tests/*.sql |