Repository navigation
Add CI workflow for tip-of-stable PostgreSQL testing #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| name: Regression and TAP against PG stable-branch tips | ||
| run-name: Check spock against fresh stable PostgreSQL branches | ||
|
|
||
| # Builds PostgreSQL from the live tip of REL_${PGVER}_STABLE (not a tagged | ||
| # release) with stock configure flags, applies spock's version-specific | ||
| # patches per the README, builds spock per the README, and runs the | ||
| # regression and TAP suites. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| # Cancel in-flight runs on the same ref when a new commit lands. | ||
| concurrency: | ||
| group: pg-stable-test-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| pgver: [15, 16, 17, 18] | ||
|
|
||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
|
|
||
| env: | ||
| PG_PREFIX: ${{ github.workspace }}/pg-install | ||
| PG_SRCDIR: ${{ github.workspace }}/postgres | ||
|
|
||
| steps: | ||
| - name: Checkout spock | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: spock | ||
|
|
||
| - name: Install build dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| build-essential bison flex \ | ||
| libreadline-dev zlib1g-dev \ | ||
| libipc-run-perl libtest-simple-perl | ||
|
|
||
| - name: Clone PostgreSQL stable-branch tip | ||
| run: | | ||
| git clone --branch REL_${{ matrix.pgver }}_STABLE --depth 1 \ | ||
| https://github.com/postgres/postgres.git "$PG_SRCDIR" | ||
| cd "$PG_SRCDIR" | ||
| echo "Cloned $(git rev-parse --short HEAD) on REL_${{ matrix.pgver }}_STABLE" | ||
|
|
||
| # README step 2: apply spock patches in numerical order. Glob | ||
| # expansion gives us "pgN-000-...", "pgN-015-...", etc., in order. | ||
| - name: Apply spock patches | ||
| run: | | ||
| PATCH_DIR="${GITHUB_WORKSPACE}/spock/patches/${{ matrix.pgver }}" | ||
| if [ -d "$PATCH_DIR" ] && [ -n "$(ls -A "$PATCH_DIR" 2>/dev/null)" ]; then | ||
| cd "$PG_SRCDIR" | ||
| for p in "$PATCH_DIR"/*; do | ||
| echo "Applying $(basename "$p")" | ||
| patch -p1 < "$p" | ||
| done | ||
| else | ||
| echo "No spock patches for PG ${{ matrix.pgver }}; using vanilla source" | ||
| fi | ||
|
danolivo marked this conversation as resolved.
|
||
|
|
||
| # README step 3: configure / make / make install the Postgres server. | ||
| # Stock flags; --enable-tap-tests is the one CI-only addition we need | ||
| # so the spock TAP suite can run. | ||
| # The dblink contrib extension is needed by some spock TAP tests. | ||
| - name: Configure, build, install PostgreSQL | ||
| run: | | ||
| cd "$PG_SRCDIR" | ||
| ./configure --prefix="$PG_PREFIX" --enable-tap-tests | ||
| make -j"$(nproc)" -s | ||
| make install -s | ||
| make -j"$(nproc)" -s -C contrib/dblink | ||
| make install -s -C contrib/dblink | ||
|
|
||
| # README step 4: pg_config on PATH. | ||
| # README step 6: make && make install spock. | ||
| - name: Build and install spock | ||
| run: | | ||
| export PATH="$PG_PREFIX/bin:$PATH" | ||
| cd "${GITHUB_WORKSPACE}/spock" | ||
| make -j"$(nproc)" | ||
| make install | ||
|
|
||
| - name: Run regression suite | ||
| run: | | ||
| export PATH="$PG_PREFIX/bin:$PATH" | ||
| cd "${GITHUB_WORKSPACE}/spock" | ||
| make regresscheck | ||
|
|
||
| - name: Upload regression artifacts on failure | ||
| if: ${{ failure() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: regress-stable-tip-${{ matrix.pgver }} | ||
| path: | | ||
| spock/tests/regress/regression_output/** | ||
| spock/tests/regress/regression.diffs | ||
| spock/tests/regress/regression.out | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
|
|
||
| - name: Run TAP suite | ||
| run: | | ||
| export PATH="$PG_PREFIX/bin:$PATH" | ||
| export PG_CONFIG="$PG_PREFIX/bin/pg_config" | ||
| cd "${GITHUB_WORKSPACE}/spock/tests/tap" | ||
| ./run_tests.sh | ||
|
danolivo marked this conversation as resolved.
|
||
|
|
||
| - name: Upload TAP artifacts on failure | ||
| if: ${{ failure() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pg-stable-test-${{ matrix.pgver }} | ||
| path: | | ||
| spock/tests/tap/logs/** | ||
| spock/tests/logs/** | ||
| if-no-files-found: ignore | ||
| retention-days: 7 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.