name: core

permissions:
  contents: read

on:
  workflow_dispatch:
  pull_request:
    paths:
    - 'FirebaseCore**'
    - '.github/workflows/core.yml'
    - '.github/workflows/common.yml'
    - '.github/workflows/common_cocoapods.yml'
    - '.github/workflows/common_catalyst.yml'
    - '.github/workflows/common_cocoapods_cron.yml'
    - 'Gemfile*'
  schedule:
    # Run every day at 3am (PDT) / 6am (EDT) - cron uses UTC times
    - cron:  '0 10 * * *'

concurrency:
    group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
    cancel-in-progress: true

jobs:
  spm:
    uses: ./.github/workflows/common.yml
    with:
      target: CoreUnit

  catalyst:
    uses: ./.github/workflows/common_catalyst.yml
    with:
      product: FirebaseCore
      target: FirebaseCore-Unit-unit

  pod_lib_lint:
    uses: ./.github/workflows/common_cocoapods.yml
    with:
      product: FirebaseCore

  core-cron-only:
    needs: pod_lib_lint
    uses: ./.github/workflows/common_cocoapods_cron.yml
    with:
      product: FirebaseCore
      platforms: '[ "ios", "tvos", "macos" ]'
      flags: '[ "--use-static-frameworks" ]'
      runs_on: macos-14
      xcode: Xcode_16.2
