name: pg19-cache

# Keeps the build of PostgreSQL 19 (.github/actions/pg19) in the cache of the default branch, which every pull request reads: the head of REL_19_STABLE
# moves often, and a pull request run takes the newest build the cache has instead of compiling one. A change of the recipe builds again at once. Never blocks anything.
# No scheduled run is enabled in this repository: dispatch the workflow to run it.
on:
  push:
    branches: [main]
    paths:
      - .github/workflows/pg19-cache.yml
      - .github/actions/pg19/**
      - scripts/pg19-build.sh
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: pg19-cache
  cancel-in-progress: true

jobs:
  build:
    name: Build PostgreSQL 19
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v6

      - uses: ./.github/actions/pg19
        with:
          exact: true
