From 3223577bcb76d7a19789f131940de540bd488582 Mon Sep 17 00:00:00 2001 From: Joe Ziminski <55797454+JoeZiminski@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:42:08 +0100 Subject: [PATCH] Make CI run with weekly cron job. (#414) * Blindly add CI chat gpt output! * Add obvious error for testing purposes. * Add pull request for testing. * Only create single issue if any CI fails. * Remove automated issue raising. * Add note on what branches it runs. * Remove the divide by zero error introduced for testing. * Try and use just one job. * Fix file. * Quick test cronning every 1 minuite! * Oh yea no way to test because it only runs on main. In that case, push and hope! * Delete unused old test file. --- .github/workflows/code_test_and_deploy.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_test_and_deploy.yml b/.github/workflows/code_test_and_deploy.yml index b23bd328..7f51dc80 100644 --- a/.github/workflows/code_test_and_deploy.yml +++ b/.github/workflows/code_test_and_deploy.yml @@ -7,6 +7,10 @@ on: tags: - '*' pull_request: + schedule: + # Weekly cron job at 12:00 AM UTC on Mondays. + # This will only run on main by default. + - cron: '0 0 * * 1' jobs: linting: @@ -25,9 +29,12 @@ jobs: strategy: matrix: - # macos-14 is M1, macos-13 is intel + # macos-14 is M1, macos-13 is intel. Run on earliest and + # latest python versions. All python versions are tested in + # the weekly cron job. os: [windows-latest, ubuntu-latest, macos-14, macos-13] - python-version: ["3.9", "3.10", "3.11", "3.12"] + # Test all Python versions for cron job, and only first/last for other triggers + python-version: ${{ fromJson(github.event_name == 'schedule' && '["3.9", "3.10", "3.11", "3.12"]' || '["3.9", "3.12"]') }} steps: - uses: actions/checkout@v4