name: ci

on:  # yamllint disable-line rule:truthy
  push:
    branches:
      - master
      - maint
      - ci/all
      - ci/github
  pull_request:
    branches:
      - master
      - maint
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

permissions:
  contents: read

jobs:

  test:
    uses: ./.github/workflows/ci-test.yml

  abi:
    uses: ./.github/workflows/ci-abi.yml

  build:
    uses: ./.github/workflows/ci-build.yml

  check:
    uses: ./.github/workflows/ci-check.yml

  cover:
    uses: ./.github/workflows/ci-cover.yml

  ci-status:
    runs-on: ubuntu-latest
    if: ${{ success() || failure() }}
    needs:
      - test
      - abi
      - build
      - check
      - cover
    steps:
    - uses: step-security/harden-runner@v2
    - run: ${{ !(contains(needs.*.result, 'failure')) }}
