Skip to content

Fix pgxn

Fix pgxn #276

Workflow file for this run

name: Run Tests
permissions: {}
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
run_tests:
name: Run test
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
PG_VERSION: [14, 15, 16, 17]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set environment variables
run: echo "PG_VERSION=${{ matrix.PG_VERSION }}" >> $GITHUB_ENV
- name: Add gcc problem matcher
run: echo "::add-matcher::matcher.json"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Restore Build Image from cache
id: cache-build-image-restore
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-PG-${{ matrix.PG_VERSION }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Build Docker Test Image
id: build-test-image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
load: true
build-args: "PG_VERSION=${{ matrix.PG_VERSION }}"
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: pg_tracing_test:${{ matrix.PG_VERSION }}
- name: Save Build Image in cache
id: cache-build-image-save
if: always() && steps.cache-build-image-restore.outputs.cache-hit != 'true' && steps.build-test-image.outcome == 'success'
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-PG-${{ matrix.PG_VERSION }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Check pgindent
# pgindent is only available starting PG 17
if: ${{ matrix.PG_VERSION > 16 }}
timeout-minutes: 1
run: make run-pgindent-diff
- name: Run Test
timeout-minutes: 1
run: make run-test