1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-02-11 13:53:03 +02:00
David Steele f92ce674f7
Automatically create PostgreSQL version interfaces.
Maintaining the version interfaces was complicated by the fact that each interface needed to be in separate compilation unit to avoid type conflicts. This also meant that various build/test files needed to be updated to add the new interfaces.

Solve these problems by auto-generating all the interfaces into a single file. This is made possible by parsing defines and types out of the header files and creating macros to rename the types. At the end of the version interface everything is undef'd. Another benefit is that the auto-generated interfaces can be static and included directly into postgres/interface.c.

Since some code generation is now always required for tests, change --no-gen to --min-gen in test.pl.

It would also make sense to auto-generate the version defines in postgres/version.h, but that will be left for a future commit.
2022-06-06 13:52:56 -04:00

131 lines
4.1 KiB
YAML

name: test
on:
push:
branches:
- integration
- '**-ci'
- '**-cig'
pull_request:
branches:
- integration
- '**-ci'
- '**-cig'
jobs:
test:
runs-on: ubuntu-20.04
strategy:
# Let all the jobs run to completion even if one fails
fail-fast: false
# The first jobs should be the canaries in the coal mine, i.e. the most likely to fail if there are problems in the code. They
# should also be a good mix of unit, integration, and documentation tests.
#
# In general tests should be ordered from slowest to fastest. This does not make a difference for testing a single commit, but
# when multiple commits are being tested it is best to have the slowest jobs first so that as jobs become available they will
# tackle the slowest tests first.
matrix:
include:
# All unit tests (without coverage) for 32-bit
- param: test --vm=u18 --param=no-performance --param=c-only
# All integration tests for 32-bit
- param: test --vm=u18 --param=module=mock --param=module=real
# Debian/Ubuntu documentation
- param: doc --vm=u18
# All integration tests
- param: test --vm=u20 --param=build-package --param=module=mock --param=module=real
# All unit tests (with coverage) on the newest gcc available
- param: test --vm=f33 --param=c-only --param=tz=America/New_York
# RHEL documentation
- param: doc --vm=rh8
# All integration tests
- param: test --vm=rh7 --param=module=mock --param=module=real
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
path: pgbackrest
- name: Run Test
run: cd ${HOME?} && ${GITHUB_WORKSPACE?}/pgbackrest/test/ci.pl ${{matrix.param}} --param=build-max=2
# Basic tests on other architectures using emulation. The emulation is so slow that running all the unit tests would be too
# expensive, but this at least shows that the build works and some of the more complex tests run. In particular, it is good to
# test on one big-endian architecture to be sure that checksums are correct.
arch:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- arch: ppc64le
distro: ubuntu20.04
- arch: s390x
distro: ubuntu20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
path: pgbackrest
- name: Run Test
uses: uraimo/run-on-arch-action@v2.1.0
id: runcmd
with:
arch: ${{matrix.arch}}
distro: ${{matrix.distro}}
# Cache builds
githubToken: ${{github.token}}
install: |
apt-get update
DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive apt-get install -y perl sudo libxml-checker-perl libyaml-perl rsync zlib1g-dev libssl-dev libxml2-dev libpq-dev libyaml-dev pkg-config make gcc ccache meson git liblz4-dev liblz4-tool zstd libzstd-dev bzip2 libbz2-dev
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE?}/pgbackrest
${GITHUB_WORKSPACE?}/pgbackrest/test/test.pl --vm=none --min-gen --no-valgrind --no-coverage --no-optimize --build-max=2 --module=command --test=backup
${GITHUB_WORKSPACE?}/pgbackrest/test/test.pl --vm=none --min-gen --no-valgrind --no-coverage --no-optimize --build-max=2 --module=postgres --test=interface
codeql:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language:
- cpp
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Packages
run: sudo apt-get install -y --no-install-recommends libyaml-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{matrix.language}}
- name: Build
run: ${GITHUB_WORKSPACE?}/src/configure && make -j 2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2