Skip to content

Nightly Cache Recreation #40

Nightly Cache Recreation

Nightly Cache Recreation #40

# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
# Workflow: Nightly Cache Recreation
#
# Recreates all Bazel caches (disk + repository) from scratch.
#
# Phase 1 — Fetch (sequential): Each job runs with --nobuild to populate
# the repository cache without compiling. Jobs run sequentially so the
# repo cache accumulates across configs.
#
# Phase 2 — Build (parallel): All jobs run the actual builds in parallel,
# restoring the complete repo cache from Phase 1. Each job saves its own
# disk cache.
#
# Can also be triggered manually via workflow_dispatch.
name: Nightly Cache Recreation
on:
schedule:
- cron: "0 0 * * *" # midnight UTC
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
# ======================================================================
# Phase 1: Fetch dependencies (sequential, --nobuild)
# Populates the shared repository cache without compiling.
# ======================================================================
fetch-qnx:
uses: ./.github/workflows/build_and_test_qnx.yml
with:
cache_mode: "recreate"
fetch_only: "true"
secrets:
SCORE_QNX_LICENSE: ${{ secrets.SCORE_QNX_LICENSE }}
SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }}
SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }}
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
permissions:
contents: read
actions: write
pull-requests: read
fetch-host-build:
needs: fetch-qnx
uses: ./.github/workflows/_build_and_test_gcc15.yml
with:
cache-mode: "recreate-update"
fetch-only: "true"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
fetch-tsan:
needs: fetch-host-build
uses: ./.github/workflows/_thread_sanitizer.yml
with:
cache-mode: "recreate-update"
fetch-only: "true"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
fetch-asan:
needs: fetch-tsan
uses: ./.github/workflows/_address_sanitizer.yml
with:
cache-mode: "recreate-update"
fetch-only: "true"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
fetch-linters:
needs: fetch-asan
uses: ./.github/workflows/_linter.yml
with:
cache-mode: "recreate-update"
fetch-only: "true"
permissions:
contents: read
actions: write
security-events: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
fetch-coverage:
needs: fetch-linters
uses: ./.github/workflows/_coverage_report.yml
with:
cache-mode: "recreate-update"
fetch-only: "true"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
fetch-codeql:
needs: fetch-coverage
uses: ./.github/workflows/_codeql.yml
with:
cache-mode: "recreate-update"
fetch-only: "true"
permissions:
contents: read
actions: write
security-events: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
# ======================================================================
# Phase 2: Build (parallel)
# All jobs restore the repo cache from Phase 1 and build their disk cache.
# ======================================================================
build-host:
needs: fetch-codeql
uses: ./.github/workflows/_build_and_test_gcc15.yml
with:
cache-mode: "recreate-update"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
build-tsan:
needs: fetch-codeql
uses: ./.github/workflows/_thread_sanitizer.yml
with:
cache-mode: "recreate-update"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
build-asan:
needs: fetch-codeql
uses: ./.github/workflows/_address_sanitizer.yml
with:
cache-mode: "recreate-update"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
build-linters:
needs: fetch-codeql
uses: ./.github/workflows/_linter.yml
with:
cache-mode: "recreate-update"
permissions:
contents: read
actions: write
security-events: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
build-coverage:
needs: fetch-codeql
uses: ./.github/workflows/_coverage_report.yml
with:
cache-mode: "recreate-update"
permissions:
contents: read
actions: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
build-codeql:
needs: fetch-codeql
uses: ./.github/workflows/_codeql.yml
with:
cache-mode: "recreate-update"
permissions:
contents: read
actions: write
security-events: write
secrets:
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
build-qnx:
needs: fetch-codeql
uses: ./.github/workflows/build_and_test_qnx.yml
with:
cache_mode: "recreate-update"
secrets:
SCORE_QNX_LICENSE: ${{ secrets.SCORE_QNX_LICENSE }}
SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }}
SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }}
UBUNTU_SNAPSHOT_MIRROR_URL: ${{ secrets.UBUNTU_SNAPSHOT_MIRROR_URL }}
permissions:
contents: read
actions: write
pull-requests: read