name: Build (daily --no-build-cache)

on:
  schedule:
    # daily at 4:48 UTC
    - cron: "48 4 * * *"
  workflow_dispatch:

jobs:
  common:
    uses: ./.github/workflows/build-common.yml
    with:
      no-build-cache: true
    secrets:
      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

  test-latest-deps:
    uses: ./.github/workflows/reusable-test-latest-deps.yml
    with:
      no-build-cache: true
    secrets:
      GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

  # muzzle is not included here because it doesn't use gradle cache anyway and so is already covered
  # by the normal daily build

  # markdown-link-check and misspell-check are not included here because they don't use gradle cache
  # anyway and so are already covered by the normal daily build

  workflow-notification:
    needs:
      - common
      - test-latest-deps
    if: always()
    uses: ./.github/workflows/reusable-workflow-notification.yml
    with:
      success: >-
        ${{
          needs.common.result == 'success' &&
          needs.test-latest-deps.result == 'success'
        }}
