Skip to content

Commit

Permalink
CI - update all GitHub action runners to ubuntu-22.04 (#7064)
Browse files Browse the repository at this point in the history
* CI - update all GitHub action runners to ubuntu-22.04

Address deprecation warning for the ubuntu-20.04 GHA runner image.

Use more conservative ubuntu-22.04, because the
ubuntu-latest image gives SSL errors in pip execution.

* REVERT ME - temporarily activate ci-daily in pull requests

* CI - install the missing Ubuntu package libffi7

* Address complaint from shellcheck-0.8.0

* Revert "REVERT ME - temporarily activate ci-daily in pull requests"

This reverts commit f9f653e.

* Use separate GitHub actions cache for the pytest-numpy-2 job

Do not pre-install packages from a standard pytest job.
  • Loading branch information
pavoljuhas authored Feb 13, 2025
1 parent d5c2b41 commit 847f918
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 30 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -26,6 +26,10 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', 'dev_tools/requirements/**/*.txt') }}
- name: Install system requirements
run: |
sudo apt-get update
sudo apt-get install libffi7
- name: Install requirements
run: |
pip install cirq~=1.0.dev &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
# partitions should be named partition-0 to partition-(NOTEBOOK_PARTITIONS-1)
partition: [partition-0, partition-1, partition-2, partition-3]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
56 changes: 34 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
jobs:
quick_test:
name: Misc check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
run: check/misc
packaging_test:
name: Packaging test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -46,7 +46,7 @@ jobs:
run: ./dev_tools/packaging/packaging_test.sh
format:
name: Format check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -63,7 +63,7 @@ jobs:
run: check/format-incremental
mypy:
name: Type check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -78,7 +78,7 @@ jobs:
run: check/mypy
changed_files:
name: Changed files test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -95,7 +95,7 @@ jobs:
run: check/pytest-changed-files -n auto
lint:
name: Lint check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -112,7 +112,7 @@ jobs:
run: check/pylint -v
doc_test:
name: Doc test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -127,7 +127,7 @@ jobs:
run: check/doctest -q
nbformat:
name: Notebook formatting
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -142,7 +142,7 @@ jobs:
run: check/nbformat
shellcheck:
name: Shell check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -152,7 +152,7 @@ jobs:
run: check/shellcheck
isolated-modules:
name: Isolated pytest Ubuntu
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -170,7 +170,7 @@ jobs:
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -184,6 +184,10 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', 'dev_tools/requirements/**/*.txt') }}
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install libffi7
- name: Install requirements
run: |
pip install wheel
Expand All @@ -200,7 +204,7 @@ jobs:
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -213,7 +217,11 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', 'dev_tools/requirements/**/*.txt') }}
key: numpy2-${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', 'dev_tools/requirements/**/*.txt') }}
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install libffi7
- name: Install requirements
run: |
pip install wheel
Expand All @@ -222,7 +230,7 @@ jobs:
run: check/pytest -n auto --warn-numpy-data-promotion --durations=20 --ignore=cirq-rigetti
pip-compile:
name: Check consistency of requirements
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -238,7 +246,7 @@ jobs:
pip-compile --resolver=backtracking dev_tools/requirements/deps/cirq-all.txt -o-
build_protos:
name: Build protos
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -256,7 +264,7 @@ jobs:
run: check/protos-up-to-date
coverage:
name: Coverage check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -272,6 +280,10 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', 'dev_tools/requirements/**/*.txt') }}
- name: Install system requirements
run: |
sudo apt-get update
sudo apt-get install libffi7
- name: Install requirements
run: |
pip install wheel
Expand Down Expand Up @@ -347,7 +359,7 @@ jobs:
matrix:
# partitions should be named partition-0 to partition-(NOTEBOOK_PARTITIONS-1)
partition: [partition-0, partition-1, partition-2, partition-3]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -370,7 +382,7 @@ jobs:
path: out
notebooks-branch:
name: Notebook Tests against PR
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -391,7 +403,7 @@ jobs:
path: out
ts-build:
name: Bundle file consistency
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -405,7 +417,7 @@ jobs:
run: check/ts-build-current
ts-lint:
name: Typescript lint check
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -419,7 +431,7 @@ jobs:
run: check/ts-lint
ts-test:
name: Typescript tests
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand All @@ -435,7 +447,7 @@ jobs:
run: check/ts-test-e2e
ts-coverage:
name: Typescript tests coverage
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest-debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
os:
description: "Runner OS:"
type: choice
default: ubuntu-20.04
default: ubuntu-22.04
options:
- ubuntu-22.04
- ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
push_to_pypi:
if: github.repository == 'quantumlib/Cirq'
name: Push to PyPi
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
NAME: dev-release
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
stale:
name: Label and/or close stale issues and PRs
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
issues: write
pull-requests: write
Expand Down
8 changes: 5 additions & 3 deletions dev_tools/packaging/verify-published-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ if [ -z "${PROJECT_VERSION}" ]; then
exit 1
fi

typeset -a PIP_FLAGS

if [ "${PROD_SWITCH}" = "--test" ]; then
PIP_FLAGS="--index-url=https://test.pypi.org/simple/"
PIP_FLAGS=("--index-url=https://test.pypi.org/simple/")
PYPI_REPO_NAME="TEST"
PYPI_PROJECT_NAME="cirq"
elif [ "${PROD_SWITCH}" = "--prod" ]; then
PIP_FLAGS=''
PIP_FLAGS=()
PYPI_REPO_NAME="PROD"
PYPI_PROJECT_NAME="cirq"
else
Expand Down Expand Up @@ -76,7 +78,7 @@ echo "Working in a fresh virtualenv at ${tmp_dir}/${PYTHON_VERSION}"
virtualenv --quiet "--python=/usr/bin/${PYTHON_VERSION}" "${tmp_dir}/${PYTHON_VERSION}"

echo Installing "${PYPI_PROJECT_NAME}==${PROJECT_VERSION} from ${PYPI_REPO_NAME} pypi"
"${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet ${PIP_FLAGS} "${PYPI_PROJECT_NAME}==${PROJECT_VERSION}" --extra-index-url https://pypi.python.org/simple
"${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet "${PIP_FLAGS[@]}" "${PYPI_PROJECT_NAME}==${PROJECT_VERSION}" --extra-index-url https://pypi.python.org/simple

# Check that code runs without dev deps.
echo Checking that code executes
Expand Down

0 comments on commit 847f918

Please sign in to comment.