name: test-sql

on:
  push:
    paths-ignore:
      - 'website/**'
  workflow_call:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  test-sql:
    runs-on: ${{ fromJSON(vars.RUNNER) }}
    strategy:
      matrix:
        postgres-version: [ alpine, 13-alpine, 14-alpine, 15-alpine, 16-alpine, 17-alpine ]
    name: SQL Tests ${{ matrix.postgres-version }}
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
      - name: Run SQL PgTap Tests
        run: |
          make test-sql POSTGRES_DOCKER_IMAGE_BASE=docker.mirror.hashicorp.services/postgres PG_DOCKER_TAG=${{ matrix.postgres-version }}
