From a10642712fa49cb36b92abe45eb6a8828df94e24 Mon Sep 17 00:00:00 2001 From: MilesCranmerBot Date: Sun, 28 Jun 2026 18:30:10 +0000 Subject: [PATCH] ci: trim low-signal workflows to reduce Actions spend Co-authored-by: Miles Cranmer --- .github/workflows/CI.yml | 8 ++++-- .github/workflows/CI_Windows.yml | 4 +++ .github/workflows/CI_apptainer.yml | 14 ++-------- .github/workflows/CI_conda_forge.yml | 5 +--- .github/workflows/CI_docker.yml | 14 ++-------- .github/workflows/CI_docker_large_nightly.yml | 12 ++++++--- .github/workflows/CI_mac.yml | 4 +++ .github/workflows/docker_deploy.yml | 2 -- .github/workflows/docs.yml | 4 +++ .github/workflows/update_backend.yml | 26 ++++++++++++++----- 10 files changed, 51 insertions(+), 42 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index be27f15d5..15baa815a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,7 +3,8 @@ name: Linux on: push: branches: - - '**' + - master + - 'release-*' paths: - '**' tags: @@ -15,6 +16,10 @@ on: - '**' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: write @@ -285,7 +290,6 @@ jobs: uses: actions/setup-python@v6 with: python-version: '3.x' - cache: pip - name: "Install validator deps" run: | python -m pip install --upgrade pip diff --git a/.github/workflows/CI_Windows.yml b/.github/workflows/CI_Windows.yml index b1d442395..abf904e51 100644 --- a/.github/workflows/CI_Windows.yml +++ b/.github/workflows/CI_Windows.yml @@ -15,6 +15,10 @@ on: - '**' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/CI_apptainer.yml b/.github/workflows/CI_apptainer.yml index 7910b0ebe..107c9d003 100644 --- a/.github/workflows/CI_apptainer.yml +++ b/.github/workflows/CI_apptainer.yml @@ -1,18 +1,8 @@ name: Apptainer on: - push: - branches: - - 'master' - paths: - - '**' - tags: - - 'v*.*.*' - pull_request: - branches: - - 'master' - paths: - - '**' + schedule: + - cron: "0 10 8 * *" workflow_dispatch: jobs: diff --git a/.github/workflows/CI_conda_forge.yml b/.github/workflows/CI_conda_forge.yml index 6d17275aa..4954721a0 100644 --- a/.github/workflows/CI_conda_forge.yml +++ b/.github/workflows/CI_conda_forge.yml @@ -4,10 +4,7 @@ name: conda-forge on: schedule: - # Run at the 0th minute of the 10th hour (UTC). - # This means the job will run at 5am EST. - - cron: "0 10 * * *" - # This will automatically run on master branch only. + - cron: "0 10 * * 1" workflow_dispatch: jobs: diff --git a/.github/workflows/CI_docker.yml b/.github/workflows/CI_docker.yml index f71601c81..9f2173c86 100644 --- a/.github/workflows/CI_docker.yml +++ b/.github/workflows/CI_docker.yml @@ -1,18 +1,8 @@ name: Docker on: - push: - branches: - - 'master' - paths: - - '**' - tags: - - 'v*.*.*' - pull_request: - branches: - - 'master' - paths: - - '**' + schedule: + - cron: "0 10 1 * *" workflow_dispatch: jobs: diff --git a/.github/workflows/CI_docker_large_nightly.yml b/.github/workflows/CI_docker_large_nightly.yml index c7215458b..a457eb95e 100644 --- a/.github/workflows/CI_docker_large_nightly.yml +++ b/.github/workflows/CI_docker_large_nightly.yml @@ -2,15 +2,19 @@ name: Docker_Large_Nightly on: schedule: - # Run at the 0th minute of the 10th hour (UTC). - # This means the job will run at 5am EST. - - cron: "0 10 * * *" - # This will automatically run on master branch only. + - cron: "0 10 15 * *" workflow_dispatch: + inputs: + include-arm64: + description: "Also run a slow linux/arm64 QEMU smoke test" + required: false + default: false + type: boolean jobs: test: runs-on: ${{ matrix.os }} + if: ${{ matrix.arch != 'linux/arm64' || (github.event_name == 'workflow_dispatch' && inputs.include-arm64) }} continue-on-error: ${{ matrix.arch == 'linux/arm64' }} defaults: run: diff --git a/.github/workflows/CI_mac.yml b/.github/workflows/CI_mac.yml index 300f27c2e..2a37988e8 100644 --- a/.github/workflows/CI_mac.yml +++ b/.github/workflows/CI_mac.yml @@ -15,6 +15,10 @@ on: - '**' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/docker_deploy.yml b/.github/workflows/docker_deploy.yml index f3dc6aecc..a91c06886 100644 --- a/.github/workflows/docker_deploy.yml +++ b/.github/workflows/docker_deploy.yml @@ -1,8 +1,6 @@ name: Deploy Docker on: - schedule: - - cron: "0 10 * * *" push: branches: - "master" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 110b552dc..b9edfade9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,6 +20,10 @@ on: - 'README.md' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: write pull-requests: read diff --git a/.github/workflows/update_backend.yml b/.github/workflows/update_backend.yml index 9efd9c0d1..bcb70bed8 100644 --- a/.github/workflows/update_backend.yml +++ b/.github/workflows/update_backend.yml @@ -3,6 +3,12 @@ on: schedule: - cron: '00 00 * * *' workflow_dispatch: + inputs: + force: + description: "Force update even if an open PR already exists" + required: false + default: false + type: boolean permissions: contents: write @@ -17,7 +23,6 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3' - cache: pip - name: "Install dependencies" run: python -m pip install --upgrade pip @@ -30,12 +35,25 @@ jobs: cd SymbolicRegression.jl echo "version=$(git describe --tags --match='v*' --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT + - name: "Check for existing open PR" + id: existing-pr + env: + GH_TOKEN: ${{ github.token }} + run: | + if gh pr list --repo "$GITHUB_REPOSITORY" --head "backend-update/v${{ steps.get-latest.outputs.version }}" --state open | grep -q .; then + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "exists=false" >> $GITHUB_OUTPUT + fi + - name: "Update SymbolicRegression.jl version in PySR" + if: ${{ steps.existing-pr.outputs.exists != 'true' || (github.event_name == 'workflow_dispatch' && inputs.force) }} run: | python .github/workflows/update_backend_version.py ${{ steps.get-latest.outputs.version }} - name: "Create PR if necessary" id: cpr + if: ${{ steps.existing-pr.outputs.exists != 'true' || (github.event_name == 'workflow_dispatch' && inputs.force) }} uses: peter-evans/create-pull-request@v8 with: branch: backend-update/v${{ steps.get-latest.outputs.version }} @@ -50,7 +68,7 @@ jobs: pysr/juliapkg.json - name: "Trigger CI workflows (backend update PR)" - if: steps.cpr.outputs.pull-request-number != '' + if: ${{ steps.cpr.outputs.pull-request-number != '' || (github.event_name == 'workflow_dispatch' && inputs.force) }} env: GH_TOKEN: ${{ github.token }} run: | @@ -58,7 +76,3 @@ jobs: gh workflow run "Linux" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true gh workflow run "Windows" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true gh workflow run "macOS" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true - gh workflow run "Docker" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true - gh workflow run "Apptainer" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true - gh workflow run "Documentation" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true - gh workflow run "CodeQL" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true