Skip to content

Commit

Permalink
Use packaged postgres for sqlsmith and coverity CI
Browse files Browse the repository at this point in the history
The sqlsmith and coverity workflows used the cache postgres build
but could not produce a build by themselves and therefore relied
on other workflows to produce the cached binaries. This patch
changes those workflows to use normal postgres packages instead
of custom built postgres to remove that dependency.
  • Loading branch information
svenklemm committed Nov 25, 2022
1 parent 26e3be1 commit b7a33a6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 68 deletions.
39 changes: 7 additions & 32 deletions .github/workflows/coverity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ on:
branches:
- coverity_scan
jobs:
config:
runs-on: ubuntu-latest
outputs:
pg_latest: ${{ steps.setter.outputs.PG_LATEST }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Read configuration
id: setter
run: python .github/gh_config_reader.py

coverity:
name: Coverity ${{ matrix.pg }}
Expand All @@ -25,35 +15,20 @@ jobs:
strategy:
fail-fast: false
matrix:
pg: ${{ fromJson(needs.config.outputs.pg_latest) }}
pg: [12,13,14]
os: [ubuntu-20.04]
env:
PG_SRC_DIR: pgbuild
PG_INSTALL_DIR: postgresql
MAKE_JOBS: 4
steps:
- name: Install Dependencies
run: sudo apt install flex bison clang-9 llvm-9 llvm-9-dev llvm-9-tools

# this workflow depends on the cached postgres build from the main regression
# workflow since that workflow runs daily there should always be a cache hit
- name: Cache PostgreSQL ${{ matrix.pg }}
id: cache-postgresql
uses: actions/cache@v3
with:
path: ~/${{ env.PG_SRC_DIR }}
key: ${{ matrix.os }}-postgresql-${{ matrix.pg }}-gcc-Release

# we abort on cache miss otherwise we would have to reproduce most variables
# of the main regression build matrix in this workflow
- name: Abort on cache miss
if: steps.cache-postgresql.outputs.cache-hit != 'true'
run: false

- name: Install PostgreSQL ${{ matrix.pg }}
run: |
make -C ~/$PG_SRC_DIR install
make -C ~/$PG_SRC_DIR/contrib/postgres_fdw install
sudo apt-get update
sudo apt-get install gnupg systemd-coredump gdb postgresql-common libkrb5-dev
yes | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt-get update
sudo apt-get install postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }}
- name: Checkout TimescaleDB
uses: actions/checkout@v3
Expand All @@ -67,7 +42,7 @@ jobs:
- name: Build TimescaleDB
run: |
PATH="$GITHUB_WORKSPACE/coverity/bin:$PATH"
./bootstrap -DCMAKE_BUILD_TYPE=Release -DPG_SOURCE_DIR=~/$PG_SRC_DIR -DPG_PATH=~/$PG_INSTALL_DIR
./bootstrap -DCMAKE_BUILD_TYPE=Release
cov-build --dir cov-int make -C build
- name: Upload report
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ jobs:
uses: actions/cache@v3
with:
path: ~/${{ env.PG_SRC_DIR }}
key: ${{ matrix.os }}-postgresql-${{ matrix.pg }}-${{ matrix.cc }}-${{ matrix.build_type }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('.github/**') }}${{ env.CACHE_SUFFIX }}
key: ${{ matrix.os }}-postgresql-${{ matrix.pg }}-${{ matrix.cc }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('.github/**') }}${{ env.CACHE_SUFFIX }}

- name: Build PostgreSQL ${{ matrix.pg }}${{ matrix.snapshot }} ${{ matrix.build_type }}
- name: Build PostgreSQL ${{ matrix.pg }}${{ matrix.snapshot }}
if: steps.cache-postgresql.outputs.cache-hit != 'true'
run: |
if [ "${{ matrix.snapshot }}" = "snapshot" ]; then
Expand All @@ -112,7 +112,7 @@ jobs:
make -j $MAKE_JOBS -C src/test/isolation
make -j $MAKE_JOBS -C contrib/postgres_fdw
- name: Install PostgreSQL ${{ matrix.pg }} ${{ matrix.build_type }}
- name: Install PostgreSQL ${{ matrix.pg }}
run: |
make -C ~/$PG_SRC_DIR install
make -C ~/$PG_SRC_DIR/contrib/postgres_fdw install
Expand Down
41 changes: 8 additions & 33 deletions .github/workflows/sqlsmith.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,14 @@ on:
branches:
- sqlsmith
jobs:
config:
runs-on: ubuntu-latest
outputs:
pg14_latest: ${{ steps.setter.outputs.PG14_LATEST }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Read configuration
id: setter
run: python .github/gh_config_reader.py

regress:
sqlsmith:
name: SQLsmith PG${{ matrix.pg }}
runs-on: ${{ matrix.os }}
needs: config
strategy:
matrix:
os: ["ubuntu-20.04"]
pg: [ "${{ fromJson(needs.config.outputs.pg14_latest) }}" ]
cc: ["gcc"]
pg: [ "14" ]
build_type: ["Debug"]
fail-fast: false
env:
Expand All @@ -38,27 +26,14 @@ jobs:
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install flex bison systemd-coredump gdb clang-9 llvm-9 llvm-9-dev llvm-9-tools build-essential autoconf autoconf-archive libpqxx-dev libboost-regex-dev libsqlite3-dev
# this workflow depends on the cached postgres build from the main regression
# workflow since that workflow runs daily there should always be a cache hit
- name: Cache PostgreSQL ${{ matrix.pg }}
id: cache-postgresql
uses: actions/cache@v3
with:
path: ~/${{ env.PG_SRC_DIR }}
key: ${{ matrix.os }}-postgresql-${{ matrix.pg }}-${{ matrix.cc }}-${{ matrix.build_type }}

# we abort on cache miss otherwise we would have to reproduce most variables
# of the main regression build matrix in this workflow
- name: Abort on cache miss
if: steps.cache-postgresql.outputs.cache-hit != 'true'
run: false
- name: Install PostgreSQL ${{ matrix.pg }} ${{ matrix.build_type }}
- name: Install Dependencies
run: |
make -C ~/$PG_SRC_DIR install
make -C ~/$PG_SRC_DIR/contrib/postgres_fdw install
sudo apt-get update
sudo apt-get install gnupg systemd-coredump gdb postgresql-common libkrb5-dev build-essential autoconf autoconf-archive libpqxx-dev libboost-regex-dev libsqlite3-dev
yes | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt-get update
sudo apt-get install postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }}
- name: Checkout TimescaleDB
uses: actions/checkout@v3
Expand Down

0 comments on commit b7a33a6

Please sign in to comment.