name: C

on:
  workflow_dispatch:
  workflow_call:

env:
  # 2020.11
  vcpkgGitRef: 0bf3923f9fab4001c00f0f429682a0853b5749e0

concurrency:
  group: only-c-${{ github.ref }}-${{ github.event_path }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
  # Run the C integration tests.
  default:
    uses: ./.github/workflows/c-tests.yml
    with:
      all-platforms: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

  # Run the C benchmark tests.
  benchmarking:
    uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main
    with:
      target: "C"

  # Run the CCpp integration tests.
  ccpp:
    uses: ./.github/workflows/c-tests.yml
    with:
      use-cpp: true
      all-platforms: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

  # Run the Uclid-based LF Verifier benchmarks.
  verifier:
    uses: ./.github/workflows/c-verifier-tests.yml
