Running Regression Tests and Spockbench #709
Workflow file for this run
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
| name: Regression Tests and Spockbench | |
| run-name: Running Regression Tests and Spockbench | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| jobs: | |
| pull-and-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| pgver: [15, 16, 17, 18] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout spock | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: Checkout spockbench | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: pgedge/spockbench | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| path: spockbench | |
| ref: master | |
| - name: Add permissions | |
| run: | | |
| sudo chmod -R a+w ${GITHUB_WORKSPACE} | |
| - name: Set up Docker | |
| # Codacy wants us to use full commit SHA. This is for v3 | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Set up docker compose | |
| # Codacy wants us to use full commit SHA. This is for v1 | |
| uses: docker/setup-compose-action@364cc21a5de5b1ee4a7f5f9d3fa374ce0ccde746 # v1 | |
| with: | |
| version: latest | |
| - name: Build docker container | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/ | |
| docker build \ | |
| --build-arg PGVER=${{ matrix.pgver }} \ | |
| -t spock -f tests/docker/Dockerfile-step-1.el9 . | |
| - name: Run regression tests | |
| run: | | |
| REG_CT_NAME="spock-regress-${{ matrix.pgver }}-${{ github.run_id }}-${{ github.run_attempt }}" | |
| echo "REG_CT_NAME=$REG_CT_NAME" >> "$GITHUB_ENV" | |
| docker run --name "$REG_CT_NAME" -e PGVER=${{ matrix.pgver }} spock /home/pgedge/run-spock-regress.sh | |
| timeout-minutes: 15 | |
| - name: Collect regression artifacts (from container) | |
| if: ${{ always() }} | |
| run: | | |
| docker cp "$REG_CT_NAME":/home/pgedge/spock/tests/regress/regression_output "${GITHUB_WORKSPACE}/tests/regress/" || true | |
| docker rm -f "$REG_CT_NAME" || true | |
| - name: Upload regression artifacts | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: regress-${{ matrix.pgver }} | |
| path: | | |
| tests/regress/regression_output/** | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| - name: Run TAP tests | |
| run: | | |
| TAP_CT_NAME="spock-tap-${{ matrix.pgver }}-${{ github.run_id }}-${{ github.run_attempt }}" | |
| echo "TAP_CT_NAME=$TAP_CT_NAME" >> "$GITHUB_ENV" | |
| docker run --name "$TAP_CT_NAME" -e PGVER=${{ matrix.pgver }} --workdir=/home/pgedge/spock/tests/tap \ | |
| spock /home/pgedge/spock/tests/tap/run_tests.sh | |
| timeout-minutes: 15 | |
| - name: Collect TAP artifacts (from container) | |
| if: ${{ always() }} | |
| run: | | |
| docker cp "$TAP_CT_NAME":/home/pgedge/spock/tests/tap/logs "${GITHUB_WORKSPACE}/tests/tap/logs" || true | |
| docker cp "$TAP_CT_NAME":/home/pgedge/spock/tests/logs "${GITHUB_WORKSPACE}/tests/logs" || true | |
| docker rm -f "$TAP_CT_NAME" || true | |
| - name: Upload TAP artifacts | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tap-${{ matrix.pgver }} | |
| path: | | |
| tests/tap/logs/** | |
| tests/logs/** | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| - name: Start docker | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/tests/docker/ | |
| echo PG_VER=${{ matrix.pgver }} >> pgedge.env | |
| docker compose up | |
| - name: Check spockbench output | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/tests/docker | |
| ./check-outputs.sh | |