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

on:
  schedule:
    # strange schedule to reduce the risk of DDOS GitHub infra
    - cron: "48 4 * * *"
  workflow_dispatch:

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

  test:
    uses: ./.github/workflows/reusable-test.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 }}

  smoke-test:
    uses: ./.github/workflows/reusable-smoke-test.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

  gradle-plugins:
    uses: ./.github/workflows/reusable-gradle-plugins.yml
    with:
      no-build-cache: true

  examples:
    uses: ./.github/workflows/reusable-examples.yml
    with:
      no-build-cache: true

  # 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

  open-issue-on-failure:
    needs:
      - assemble
      - test
      - test-latest-deps
      - smoke-test
      - gradle-plugins
      - examples
    if: failure()
    uses: ./.github/workflows/reusable-create-issue-for-failure.yml
