name: Database Adapter Continues Integration

on:
  workflow_call:
  pull_request:
    types: [opened, synchronize, reopened]
    paths:
      - "apps/db-adapter**"
      - ".github/workflows/db_adapter_ci.yml"
      - ".github/workflows/go_test.yml"
      - ".github/workflows/docker_build.yml"

jobs:
    golangci:
        name: lint
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-go@v5
            with:
              go-version: '1.24'
              cache: false
          - name: golangci-lint
            uses: golangci/golangci-lint-action@v7
            with:
              version: latest
              working-directory: 'apps/db-adapter'
              
    test:
        uses: ./.github/workflows/go_test.yml
        needs: golangci
        with:
            working-directory: 'apps/db-adapter'

    build:
        needs: test
        uses: ./.github/workflows/docker_build.yml
        with:
            working-directory: 'apps/db-adapter'
            service-name: 'gheritage-db-adapter'
