From f2cc964b3da85b77453cf5a62030f3001cfee225 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Tue, 2 Jul 2024 16:36:54 +0100 Subject: [PATCH] Schedule CI daily at 5am to detect code rot early (#7363) * Schedule CI daily at 5am * Package but don't upload when cron * Update ChangeLog * Comment explaining CI use --- .github/workflows/ci.yml | 21 ++++++++++++++------- .github/workflows/stale-issues.yml | 2 +- ChangeLog | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e676c2ec2..12164d199 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +# All-in-one continuous integration (CI) workflow. +# Runs on all platforms (Windows, macOS, and Linux) +# for all events (pull request, release, and schedule). + name: CI on: @@ -14,10 +18,13 @@ on: - ready_for_review release: types: [published] + schedule: + - cron: "0 5 * * *" env: SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }} - ENABLE_PACKAGING: ${{ !github.event.pull_request.draft }} + PACKAGE_BUILD: ${{ !github.event.pull_request.draft }} + PACKAGE_UPLOAD: ${{ !github.event.pull_request.draft && github.event_name != 'schedule' }} UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }} UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }} @@ -68,14 +75,14 @@ jobs: run: ./build/bin/unittests - name: Package - if: ${{ env.ENABLE_PACKAGING == 'true' }} + if: ${{ env.PACKAGE_BUILD == 'true' }} run: python ./scripts/package.py env: WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }} WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }} - name: Upload - if: ${{ env.ENABLE_PACKAGING == 'true' }} + if: ${{ env.PACKAGE_UPLOAD == 'true' }} uses: ./.github/actions/dist-upload with: use_github: ${{ env.UPLOAD_TO_GITHUB }} @@ -133,7 +140,7 @@ jobs: run: ./build/bin/unittests - name: Package - if: ${{ env.ENABLE_PACKAGING == 'true' }} + if: ${{ env.PACKAGE_BUILD == 'true' }} run: ./scripts/package.py env: APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }} @@ -144,7 +151,7 @@ jobs: APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - name: Upload - if: ${{ env.ENABLE_PACKAGING == 'true' }} + if: ${{ env.PACKAGE_UPLOAD == 'true' }} uses: ./.github/actions/dist-upload with: use_github: ${{ env.UPLOAD_TO_GITHUB }} @@ -258,14 +265,14 @@ jobs: run: ./build/bin/unittests - name: Package - if: ${{ !matrix.distro.skip-package && env.ENABLE_PACKAGING == 'true' }} + if: ${{ env.PACKAGE_BUILD == 'true' }} env: LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }} LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }} run: ./scripts/package.py - name: Upload - if: ${{ !matrix.distro.skip-package && env.ENABLE_PACKAGING == 'true' }} + if: ${{ env.PACKAGE_UPLOAD == 'true' }} uses: ./.github/actions/dist-upload with: use_github: ${{ env.UPLOAD_TO_GITHUB }} diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index 9fec61317..b3467df1f 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -1,7 +1,7 @@ name: "Close stale issues and PRs" on: schedule: - - cron: "0 0 * * *" + - cron: "0 5 * * *" jobs: stale-issues: diff --git a/ChangeLog b/ChangeLog index 4a3d442ed..1eb1dfe2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,7 @@ Enhancements: - #7353 Re-implement packaging for GitHub workflows (macOS) - #7360 Re-implement packaging for GitHub workflows (Windows) - #7361 Re-implement packaging for GitHub workflows (Linux) +- #7363 Schedule CI daily at 5am to detect code rot early # 1.14.6