diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69eb5857c..5414f3787 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,6 +61,34 @@ jobs: - name: Run Test run: cd ${HOME?} && ${GITHUB_WORKSPACE?}/pgbackrest/test/ci.pl ${{matrix.param}} --param=build-max=2 + # C test harness. Run inside a container so tests that require socket binding work correctly. + testc: + runs-on: ubuntu-22.04 + container: + image: ubuntu:22.04 + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + with: + path: pgbackrest + + - name: Install + run: | + apt-get update + DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive apt-get install -y sudo zlib1g-dev libssl-dev libxml2-dev libpq-dev libyaml-dev pkg-config gcc ccache meson liblz4-dev liblz4-tool zstd libzstd-dev bzip2 libbz2-dev tzdata + adduser --disabled-password --gecos \"\" runner + + - name: Build + run: | + sudo -u runner cp -rp ${GITHUB_WORKSPACE?}/pgbackrest /home/runner + sudo -u runner meson -Dwerror=true -Dfatal-errors=true -Dbuildtype=debug /home/runner/test/build/none /home/runner/pgbackrest + sudo -u runner ninja -C /home/runner/test/build/none test/src/test-pgbackrest + + - name: Test + run: | + sudo -u runner /home/runner/test/build/none/test/src/test-pgbackrest --repo-path=/home/runner/pgbackrest --test-path=/home/runner/test --no-repo-copy test + # 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. diff --git a/test/src/build/config/config.yaml b/test/src/build/config/config.yaml index 574c6fab6..1f35bef43 100644 --- a/test/src/build/config/config.yaml +++ b/test/src/build/config/config.yaml @@ -10,7 +10,8 @@ command: log-level-default: DEBUG parameter-allowed: true - test: {} + test: + parameter-allowed: true noop: internal: true @@ -44,16 +45,18 @@ option: - 512KiB - 1MiB - module: - type: string - command: - test: {} - neutral-umask: type: boolean internal: true default: true + repo-copy: + type: boolean + default: true + negate: true + command: + test: {} + repo-path: type: string default: pgbackrest diff --git a/test/src/build/help/help.xml b/test/src/build/help/help.xml index 0c75423fe..8c216df0e 100644 --- a/test/src/build/help/help.xml +++ b/test/src/build/help/help.xml @@ -77,16 +77,6 @@ n - - + +