Skip to content

X

X #121

Workflow file for this run

name: Build, test and publish extensions
on:
push:
workflow_dispatch:
inputs:
extension_name:
description: "The PostgreSQL extension to build (directory name)"
required: true
type: choice
options:
- pgvector
- postgis
- pgaudit
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
permissions: {}
jobs:
# Gather extensions that have been modified
change-triage:
name: Check changed files
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix}}
steps:
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
persist-credentials: false
- name: Check for changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
_shared: &shared
- 'docker-bake.hcl'
- 'Makefile'
- 'kind-config.yaml'
- 'test/**'
- '.github/workflows/bake*.yml'
pgvector:
- 'pgvector/**'
- *shared
postgis:
- 'postgis/**'
- *shared
pgaudit:
- 'pgaudit/**'
- *shared
# Compute a matrix containing the list of all extensions that have been modified
- name: Compute matrix
id: get-matrix
env:
# JSON array containing the extensions that have been changed
CHANGES: ${{ steps.filter.outputs.changes }}
# Input Extension name
INPUT_EXTENSION_NAME: ${{ github.event.inputs.extension_name }}
run: |
if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
CHANGES="[\"$INPUT_EXTENSION_NAME\"]"
fi
# Filter away the shared filter
EXTENSIONS_CHANGED=$(echo "$CHANGES" | jq -c 'map(select(. != "_shared"))')
echo "matrix=$EXTENSIONS_CHANGED" >> "$GITHUB_OUTPUT"
Bake:
name: Bake
needs: change-triage
permissions:
packages: write
contents: read
id-token: write
security-events: write
if: ${{ join(fromJSON(needs.change-triage.outputs.matrix)) != '' }}
strategy:
fail-fast: false
matrix:
extension: ${{ fromJSON(needs.change-triage.outputs.matrix) }}
uses: ./.github/workflows/bake_targets.yml
with:
extension_name: ${{ matrix.extension }}
secrets:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}