Skip to content

Commit cd646a9

Browse files
authored
Fix CI actions on GitHub (#672)
* update linux runners to ubuntu-22 or ubuntu-latest, but run test-mem job on ubuntu-20 for it for some reason fails on ubuntu-22 * bump up CI actions to be compatible with node 20, namely bump up to actions/checkout@v4, actions/setup-python@v5, download-artifact@v4, upload-artifact@v4 * update steps involving download-artifact and upload-artifact actions per https://github.com/actions/download-artifact/blob/main/docs/MIGRATION.md * migrate to docker compose v2 * to build binary wheels for mac os, set MACOSX_DEPLOYMENT_TARGET according to the macos version * stop building and testing wheels for old Python versions 3.7, 3.8
1 parent 80e3026 commit cd646a9

File tree

7 files changed

+52
-42
lines changed

7 files changed

+52
-42
lines changed

.github/workflows/bazeltest.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
# Run tests with Bazel v5.3.0.
1313
test:
1414
name: Test with Bazel
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
strategy:
1717
matrix:
1818
# Hardware optimizers.
@@ -21,7 +21,7 @@ jobs:
2121
parallel_opt: [openmp,nopenmp]
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
- name: Checkout submodules
2626
run: git submodule update --init --recursive
2727
- name: Install Bazel on CI
@@ -43,14 +43,14 @@ jobs:
4343
4444
test-san:
4545
name: Sanitizer tests
46-
runs-on: ubuntu-20.04
46+
runs-on: ubuntu-22.04
4747
strategy:
4848
matrix:
4949
# Test sanitizers
5050
sanitizer_opt: [msan,asan]
5151

5252
steps:
53-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
5454
- name: Checkout submodules
5555
run: git submodule update --init --recursive
5656
- name: Install Bazel on CI
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: ubuntu-20.04
7676

7777
steps:
78-
- uses: actions/checkout@v2
78+
- uses: actions/checkout@v4
7979
- name: Checkout submodules
8080
run: git submodule update --init --recursive
8181
- name: Install Bazel on CI

.github/workflows/cirq_compatibility.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
jobs:
88
consistency:
99
name: Nightly Compatibility
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-python@v1
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
1414
with:
1515
python-version: '3.7'
1616
architecture: 'x64'

.github/workflows/dockertest.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
os: [ubuntu-latest]
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424
- name: Checkout submodules
2525
run: git submodule update --init --recursive
2626
- name: Build Docker images
27-
run: docker-compose build
27+
run: docker compose build
2828
- name: Run C++ tests
2929
run: docker run --rm qsim-cxx-tests:latest
3030
- name: Run Python tests
@@ -34,4 +34,4 @@ jobs:
3434
- name: Test install process
3535
run: |
3636
cd install/tests
37-
docker-compose up --build
37+
docker compose up --build

.github/workflows/python_format.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
name: Format check
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
- uses: actions/setup-python@v1
23+
- uses: actions/setup-python@v5
2424
with:
2525
python-version: '3.7'
2626
architecture: 'x64'

.github/workflows/release_wheels.yml

+20-14
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,51 @@ jobs:
1414
include:
1515
- os: macos-12 # x86_64
1616
name: mac
17+
env:
18+
macosx_deployment_target: "12.0"
1719
cibw:
18-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
20+
build: "cp39* cp310* cp311* cp312*"
1921
- os: macos-13-large # Apple Silicon
2022
name: mac_arm64
23+
env:
24+
macosx_deployment_target: "13.0"
2125
cibw:
22-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
23-
- os: ubuntu-20.04
26+
build: "cp39* cp310* cp311* cp312*"
27+
- os: ubuntu-22.04
2428
name: manylinux2014
2529
cibw:
2630
arch: x86_64
27-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
31+
build: "cp39* cp310* cp311* cp312*"
2832
manylinux_image: manylinux2014
2933
- os: windows-2019
3034
name: win_amd64
3135
architecture: x64
3236
cibw:
33-
build: "cp37-win_amd64 cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
37+
build: "cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
3438
env:
39+
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.env.macosx_deployment_target }}"
3540
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
3641
CIBW_SKIP: "*musllinux*"
3742
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
3843
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
39-
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite [email protected] && brew link --force libomp"
44+
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm@12 && brew link --overwrite [email protected] && brew link --force libomp"
4045
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}"
4146
# to install latest delocate package
4247
CIBW_DEPENDENCY_VERSIONS: "latest"
4348
# due to package and module name conflict have to temporarily move it away to run tests
44-
CIBW_BEFORE_TEST: mv {package}/qsimcirq /tmp
49+
CIBW_BEFORE_TEST: "mv {package}/qsimcirq /tmp"
4550
CIBW_TEST_EXTRAS: "dev"
4651
CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
4752
steps:
48-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
4954

5055
# Used to host cibuildwheel
51-
- uses: actions/setup-python@v2
56+
- uses: actions/setup-python@v5
5257
with:
5358
python-version: '3.11'
5459

5560
- name: Install cibuildwheel and twine
56-
run: python -m pip install cibuildwheel==2.16.2
61+
run: python -m pip install cibuildwheel==2.20.0
5762

5863
- name: Install requirements
5964
run: python -m pip install -r requirements.txt
@@ -64,20 +69,21 @@ jobs:
6469
- name: Build wheels
6570
run: python -m cibuildwheel --output-dir wheelhouse
6671

67-
- uses: actions/upload-artifact@v2
72+
- uses: actions/upload-artifact@v4
6873
with:
69-
name: python-wheels
74+
name: python-wheels-${{ matrix.name }}
7075
path: ./wheelhouse/*.whl
7176
release-wheels:
7277
name: Publish all wheels
7378
needs: [build_wheels]
7479
runs-on: ubuntu-latest
7580
steps:
7681
- name: Download build artifacts
77-
uses: actions/download-artifact@v2
82+
uses: actions/download-artifact@v4
7883
with:
79-
name: python-wheels
8084
path: dist/
85+
pattern: python-wheels-*
86+
merge-multiple: true
8187
- name: Publish wheels
8288
uses: pypa/gh-action-pypi-publish@release/v1
8389
with:

.github/workflows/testing_wheels.yml

+16-12
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,34 @@ jobs:
1919
include:
2020
- os: macos-12 # x86_64
2121
name: mac
22+
env:
23+
macosx_deployment_target: "12.0"
2224
cibw:
23-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
25+
build: "cp39* cp310* cp311* cp312*"
2426
- os: macos-13-large # Apple Silicon
2527
name: mac_arm64
28+
env:
29+
macosx_deployment_target: "13.0"
2630
cibw:
27-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
28-
- os: ubuntu-20.04
31+
build: "cp39* cp310* cp311* cp312*"
32+
- os: ubuntu-22.04
2933
name: manylinux2014
3034
cibw:
3135
arch: x86_64
32-
build: "cp37* cp38* cp39* cp310* cp311* cp312*"
36+
build: "cp39* cp310* cp311* cp312*"
3337
manylinux_image: manylinux2014
3438
- os: windows-2019
3539
name: win_amd64
3640
architecture: x64
3741
cibw:
38-
build: "cp37-win_amd64 cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
42+
build: "cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64"
3943
env:
44+
MACOSX_DEPLOYMENT_TARGET: "${{ matrix.env.macosx_deployment_target }}"
4045
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
4146
CIBW_SKIP: "*musllinux*"
4247
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
4348
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
44-
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm && brew link --overwrite [email protected] && brew link --force libomp"
49+
CIBW_BEFORE_BUILD_MACOS: "brew install libomp llvm@12 && brew link --overwrite [email protected] && brew link --force libomp"
4550
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-listdeps {wheel} && delocate-wheel --verbose --require-archs {delocate_archs} -w {dest_dir} {wheel}"
4651
# to install latest delocate package
4752
CIBW_DEPENDENCY_VERSIONS: "latest"
@@ -50,15 +55,15 @@ jobs:
5055
CIBW_TEST_EXTRAS: "dev"
5156
CIBW_TEST_COMMAND: "pytest {package}/qsimcirq_tests/qsimcirq_test.py && mv /tmp/qsimcirq {package}"
5257
steps:
53-
- uses: actions/checkout@v2
58+
- uses: actions/checkout@v4
5459

5560
# Used to host cibuildwheel
56-
- uses: actions/setup-python@v2
61+
- uses: actions/setup-python@v5
5762
with:
5863
python-version: '3.11'
5964

6065
- name: Install cibuildwheel and twine
61-
run: python -m pip install cibuildwheel==2.16.2
66+
run: python -m pip install cibuildwheel==2.20.0
6267

6368
- name: Install requirements
6469
run: python -m pip install -r requirements.txt
@@ -69,8 +74,7 @@ jobs:
6974
- name: Build wheels
7075
run: python -m cibuildwheel --output-dir wheelhouse
7176

72-
- uses: actions/upload-artifact@v2
77+
- uses: actions/upload-artifact@v4
7378
with:
74-
name: python-wheels
79+
name: python-wheels-${{ matrix.name }}
7580
path: ./wheelhouse/*.whl
76-

docs/docker.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ git submodule update --init --recursive
1919
To build qsim and run all the tests:
2020

2121
```
22-
# docker-compose up --build
22+
# docker compose up --build
2323
```
2424

25-
`docker-compose` will create the `qsim`, `qsim-cxx-tests`, and `qsim-py-tests`
25+
`docker compose` will create the `qsim`, `qsim-cxx-tests`, and `qsim-py-tests`
2626
images and automatically run all tests. A successful run should have the
2727
following messages somewhere in the logs:
2828

@@ -34,7 +34,7 @@ qsim-py-tests exited with code 0
3434
To build without running tests, simply run:
3535

3636
```
37-
# docker-compose build
37+
# docker compose build
3838
```
3939

4040
## Run Simulations

0 commit comments

Comments
 (0)