
name: CI - Release

on:
  workflow_dispatch:
    inputs:
      ref:
        required: true
        type: string
        default: {{ releaseBranch }}
  workflow_call:
    inputs:
      ref:
        required: true
        type: string
      check-sha:
        required: true
        type: string

permissions:
  contents: read
  checks: write

jobs:
  lint-all:
    {{> jobYml
      jobName="Lint All"
      jobCheckout=(obj ref="${{ inputs.ref }}")
      jobCreateCheck=(obj sha="${{ inputs.check-sha }}")
    }}
      {{> stepLintYml jobRunFlags=allFlags }}
      - name: Conclude Check
        uses: LouisBrunner/checks-action@v1.6.0
        if: steps.create-check.outputs.check-id && always()
        with:
          token: $\{{ secrets.GITHUB_TOKEN }}
          conclusion: $\{{ job.status }}
          check_id: $\{{ steps.create-check.outputs.check-id }}

  test-all:
    {{> jobMatrixYml
      jobName="Test All"
      jobCheckout=(obj ref="${{ inputs.ref }}")
      jobCreateCheck=(obj sha="${{ inputs.check-sha }}")
    }}
      {{> stepTestYml jobRunFlags=allFlags }}
      - name: Conclude Check
        uses: LouisBrunner/checks-action@v1.6.0
        if: steps.create-check.outputs.check-id && always()
        with:
          token: $\{{ secrets.GITHUB_TOKEN }}
          conclusion: $\{{ job.status }}
          check_id: $\{{ steps.create-check.outputs.check-id }}
