From 7a945cb059920a85016430e64ffadffada437194 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 14 Jan 2024 14:06:19 -0800 Subject: [PATCH 1/2] .github/workflows/ci-conda.yml: On pull_request, only run 1 macOS job --- .github/workflows/ci-conda.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 7fac038718c..6744ea83daa 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -22,11 +22,18 @@ jobs: strategy: matrix: - os: [ubuntu, macos] + os: >- + ${{ github.event_name == 'pull_request' + && fromJson('["ubuntu"]') + || fromJson('["ubuntu, "macos]') }} python: ['3.9', '3.10', '3.11'] # Optional environment is disabled for now as its not yet working # environment: [environment, environment-optional] conda-env: [environment] + include: >- + ${{ github.event_name == 'pull_request' + && fromJson('[{"os": "macos, "python": "3.11", "conda-env": "environment"}]') + || fromJson('[]') }} steps: - uses: actions/checkout@v4 From a49a7c17baf4b9f2a7e72b0e4bc92dd78b33416a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 14 Jan 2024 14:07:04 -0800 Subject: [PATCH 2/2] .github/workflows/ci-conda.yml: On pull_request, only run 1 Linux job --- .github/workflows/ci-conda.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 6744ea83daa..1bb08637099 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -22,17 +22,25 @@ jobs: strategy: matrix: + # On pushes to tags or branches, test the whole matrix. os: >- ${{ github.event_name == 'pull_request' && fromJson('["ubuntu"]') - || fromJson('["ubuntu, "macos]') }} - python: ['3.9', '3.10', '3.11'] + || fromJson('["ubuntu", "macos"]') }} + python: >- + ${{ github.event_name == 'pull_request' + && fromJson('["3.9"]') + || fromJson('["3.9", "3.10", "3.11"]') }} # Optional environment is disabled for now as its not yet working # environment: [environment, environment-optional] conda-env: [environment] + # On pull requests, only test two jobs: + # Ubuntu with Python 3.9, macOS with Python 3.10. + # Build & Test currently uses Python 3.11 (on ubuntu-focal). + # Together, they cover the supported minor Python versions. include: >- ${{ github.event_name == 'pull_request' - && fromJson('[{"os": "macos, "python": "3.11", "conda-env": "environment"}]') + && fromJson('[{"os": "macos", "python": "3.10", "conda-env": "environment"}]') || fromJson('[]') }} steps: