Skip to content

Commit 5e6bb69

Browse files
authored
Update versions of Python and GitHub runners (#1094)
1 parent d11f826 commit 5e6bb69

File tree

2 files changed

+90
-26
lines changed

2 files changed

+90
-26
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ env:
6464
python_ver: '3.12.8'
6565

6666
# Oldest Python version to use, for max_compat tests.
67-
python_compat_ver: '3.10.15'
67+
python_compat_ver: '3.11.9'
6868

6969
# Files listing dependencies we install using pip in the various jobs below.
7070
# This is used by setup-python to check whether its cache needs updating.
@@ -313,7 +313,7 @@ jobs:
313313
if: needs.changes.outputs.python == 'true'
314314
name: (Python pytest matrix)
315315
needs: [changes, setup]
316-
runs-on: ${{ matrix.os }}
316+
runs-on: ${{matrix.os}}
317317
timeout-minutes: 15
318318
strategy:
319319
matrix:
@@ -594,3 +594,44 @@ jobs:
594594
permissions: write-all
595595
with:
596596
reason: CI
597+
598+
print-debugging-info:
599+
if: failure()
600+
name: Print debugging info upon job failure
601+
runs-on: ubuntu-24.04
602+
timeout-minutes: 5
603+
steps:
604+
- name: Check out a copy of the git repository
605+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
606+
607+
- name: Set up Python with caching of pip dependencies
608+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
609+
with:
610+
python-version: ${{inputs.python_ver || env.python_ver}}
611+
architecture: 'x64'
612+
cache: pip
613+
cache-dependency-path: ${{env.python_dep_files}}
614+
615+
- name: Print debugging info upon job failure
616+
shell: bash
617+
env:
618+
GITHUB_CONTEXT: ${{toJson(github)}}
619+
RUNNER_CONTEXT: ${{toJson(runner)}}
620+
run: |
621+
echo '::group:: Shell environment'
622+
env
623+
echo '::endgroup::'
624+
echo '::group:: Installed Python packages'
625+
pip list
626+
echo '::endgroup::'
627+
echo '::group:: GitHub context'
628+
echo "The job_id is: $GITHUB_JOB"
629+
echo "The id of this action is: $GITHUB_ACTION"
630+
echo "The run id is: $GITHUB_RUN_ID"
631+
echo "GitHub SHA: $GITHUB_SHA"
632+
echo "$GITHUB_CONTEXT"
633+
echo '::endgroup::'
634+
echo '::group:: GitHub runner context'
635+
echo "$RUNNER_CONTEXT"
636+
echo '::endgroup::'
637+
echo '::group:: Matrix context'

.github/workflows/nightly-pytest.yaml

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ on:
3535
# Allow manual invocation.
3636
workflow_dispatch:
3737

38-
# Declare default permissions as read only.
38+
# Declare default workflow permissions as read only.
3939
permissions: read-all
4040

4141
jobs:
@@ -50,30 +50,27 @@ jobs:
5050
# These Python versions were carefully selected by trial and error
5151
# to be available on as many os/arch combos as possible, while also
5252
# making all necessary Python dependencies available on those combos.
53-
# TODO: add '3.13.1' once Cirq 1.5 is released.
54-
python-version: ['3.10.11', '3.11.9', '3.12.7']
55-
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-14, windows-2022]
53+
python-version: ['3.11.9', '3.12.7', '3.13.1']
54+
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, macos-14, windows-2025]
5655
arch: [x64, arm64]
5756
exclude:
57+
- os: ubuntu-24.04
58+
arch: arm64
59+
60+
- os: ubuntu-24.04-arm
61+
arch: x64
62+
5863
# MacOS 14 is only available for arm64.
5964
- os: macos-14
6065
arch: x64
6166

62-
# Windows is only available for x64.
63-
- os: windows-2022
64-
arch: arm64
65-
66-
# GitHub provides separate Ubuntu runners for ARM and x64.
67-
# We have to exclude the incompatible combinations.
68-
- os: ubuntu-22.04-arm
67+
# MacOS 15 is only available for arm64.
68+
- os: macos-15
6969
arch: x64
70-
- os: ubuntu-22.04
71-
arch: arm64
7270

73-
# 2025-01-31 dependency h5py fails to build on this combo (only).
74-
- os: ubuntu-22.04-arm
71+
# Windows 2025 is only available for x64.
72+
- os: windows-2025
7573
arch: arm64
76-
python-version: 3.12.7
7774

7875
steps:
7976
- name: Check out a copy of the OpenFermion git repository
@@ -89,19 +86,45 @@ jobs:
8986
cache-dependency-path: dev_tools/requirements/envs/pytest.env.txt
9087

9188
- name: Install OpenFermion Python requirements
92-
run: |
93-
pip install -r dev_tools/requirements/envs/pytest.env.txt
94-
echo '::group::List of installed pip packages and their versions'
95-
pip list
96-
echo '::endgroup::'
89+
run: pip install -r dev_tools/requirements/envs/pytest.env.txt
9790

9891
- name: Install cirq-core (current stable version)
99-
run: |
100-
pip install -U cirq-core ${{inputs.args}}
92+
run: pip install -U cirq-core ${{inputs.args}}
10193

10294
- name: Set up Pytest output problem matcher
10395
run: echo '::add-matcher::.github/problem-matchers/pytest.json'
10496

10597
- name: Run Pytest
98+
run: check/pytest
99+
100+
- name: Print debugging info upon job failure
101+
if: failure()
102+
shell: bash
103+
env:
104+
GITHUB_CONTEXT: ${{toJson(github)}}
105+
RUNNER_CONTEXT: ${{toJson(runner)}}
106+
MATRIX_CONTEXT: ${{toJson(matrix)}}
107+
STRATEGY_CONTEXT: ${{toJson(strategy)}}
106108
run: |
107-
check/pytest
109+
echo '::group:: Shell environment'
110+
env
111+
echo '::endgroup::'
112+
echo '::group:: Installed Python packages'
113+
pip list
114+
echo '::endgroup::'
115+
echo '::group:: GitHub context'
116+
echo "The job_id is: $GITHUB_JOB"
117+
echo "The id of this action is: $GITHUB_ACTION"
118+
echo "The run id is: $GITHUB_RUN_ID"
119+
echo "GitHub SHA: $GITHUB_SHA"
120+
echo "$GITHUB_CONTEXT"
121+
echo '::endgroup::'
122+
echo '::group:: GitHub runner context'
123+
echo "$RUNNER_CONTEXT"
124+
echo '::endgroup::'
125+
echo '::group:: Matrix context'
126+
echo "$MATRIX_CONTEXT"
127+
echo '::endgroup::'
128+
echo '::group:: Strategy context'
129+
echo "$STRATEGY_CONTEXT"
130+
echo '::endgroup::'

0 commit comments

Comments
 (0)