---
name: test (workflow_call)
on: workflow_call
permissions: {}
jobs:
  path-filter:
    # Get changed files to filter jobs
    outputs:
      renovate-config-validator: ${{steps.changes.outputs.renovate-config-validator}}
      ghalint: ${{steps.changes.outputs.ghalint}}
    runs-on: ubuntu-latest
    timeout-minutes: 10
    permissions: {}
    steps:
      - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
        id: changes
        with:
          filters: |
            renovate-config-validator:
              - renovate.json5
              - .github/workflows/test.yaml
              - .github/workflows/wc-renovate-config-validator.yaml
            ghalint:
              - .github/workflows/*.yaml
              - aqua/aqua.yaml
              - aqua/imports/ghalint.yaml
              - ghalint.yaml

  renovate-config-validator:
    uses: ./.github/workflows/wc-renovate-config-validator.yaml
    needs: path-filter
    if: needs.path-filter.outputs.renovate-config-validator == 'true'
    permissions:
      contents: read

  ghalint:
    needs: path-filter
    if: needs.path-filter.outputs.ghalint == 'true'
    uses: ./.github/workflows/wc-ghalint.yaml
    permissions: {}

  test:
    uses: ./.github/workflows/wc-test.yaml
    needs: path-filter
    permissions: {}
