diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 7fac038718c..1bb08637099 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -22,11 +22,26 @@ jobs: strategy: matrix: - os: [ubuntu, macos] - python: ['3.9', '3.10', '3.11'] + # On pushes to tags or branches, test the whole matrix. + os: >- + ${{ github.event_name == 'pull_request' + && fromJson('["ubuntu"]') + || 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.10", "conda-env": "environment"}]') + || fromJson('[]') }} steps: - uses: actions/checkout@v4