From 5c3228b06c993b2b9a80e6b7376864e3254f94b3 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 14:51:44 -0700 Subject: [PATCH 01/11] Fix broken artifact upload --- .github/workflows/ci.yml | 823 ++++++++++++++++++++------------------- 1 file changed, 426 insertions(+), 397 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c7825ba..7e9d2554 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,132 +23,156 @@ on: branches: - main jobs: - build_dist: - runs-on: ${{ matrix.os_dist.os }} - strategy: - fail-fast: false - matrix: - os_dist: [ - {os: ubuntu-latest, dist: cp36-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp37-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp38-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp39-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp310-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp311-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp312-manylinux_x86_64}, - - {os: ubuntu-latest, dist: cp36-manylinux_i686}, - {os: ubuntu-latest, dist: cp37-manylinux_i686}, - # cp38-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. - # {os: ubuntu-latest, dist: cp38-manylinux_i686}, - # cp39-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. - # {os: ubuntu-latest, dist: cp39-manylinux_i686}, - # cp310-manylinux_i686 disabled because scipy isn't prebuilt and fails to build. - # - # The actual error seen in github actions: - # - # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK - # libraries found. To build Scipy from sources, BLAS & LAPACK - # libraries need to be installed. - # - #{os: ubuntu-latest, dist: cp310-manylinux_i686}, - - # pypy manylinux builds disabled because scipy isn't prebuilt and fails to build. - # - # The actual error seen in github actions: - # - # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK - # libraries found. To build Scipy from sources, BLAS & LAPACK - # libraries need to be installed. - # - # {os: ubuntu-latest, dist: pp37-manylinux_x86_64}, - # {os: ubuntu-latest, dist: pp38-manylinux_x86_64}, - # {os: ubuntu-latest, dist: pp39-manylinux_x86_64}, - # {os: ubuntu-latest, dist: pp37-manylinux_i686}, - # {os: ubuntu-latest, dist: pp38-manylinux_i686}, - # {os: ubuntu-latest, dist: pp39-manylinux_i686}, - - # musllinux builds disabled because scipy isn't prebuilt and fails to build. - # - # The actual error seen in github actions: - # - # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK - # libraries found. To build Scipy from sources, BLAS & LAPACK - # libraries need to be installed. - # - # {os: ubuntu-latest, dist: cp36-musllinux_x86_64}, - # {os: ubuntu-latest, dist: cp37-musllinux_x86_64}, - # {os: ubuntu-latest, dist: cp38-musllinux_x86_64}, - # {os: ubuntu-latest, dist: cp39-musllinux_x86_64}, - # {os: ubuntu-latest, dist: cp310-musllinux_x86_64}, - # {os: ubuntu-latest, dist: cp36-musllinux_i686}, - # {os: ubuntu-latest, dist: cp37-musllinux_i686}, - # {os: ubuntu-latest, dist: cp38-musllinux_i686}, - # {os: ubuntu-latest, dist: cp39-musllinux_i686}, - # {os: ubuntu-latest, dist: cp310-musllinux_i686}, - - {os: macos-latest, dist: cp36-macosx_x86_64, macosarch: x86_64}, - {os: macos-latest, dist: cp37-macosx_x86_64, macosarch: x86_64}, - {os: macos-latest, dist: cp38-macosx_x86_64, macosarch: x86_64}, - {os: macos-latest, dist: cp39-macosx_x86_64, macosarch: x86_64}, - {os: macos-latest, dist: cp310-macosx_x86_64, macosarch: x86_64}, - {os: macos-latest, dist: cp311-macosx_x86_64, macosarch: x86_64}, - {os: macos-latest, dist: cp312-macosx_x86_64, macosarch: x86_64}, - - {os: macos-latest, dist: cp38-macosx_arm64, macosarch: arm64}, - {os: macos-latest, dist: cp39-macosx_arm64, macosarch: arm64}, - {os: macos-latest, dist: cp310-macosx_arm64, macosarch: arm64}, - {os: macos-latest, dist: cp311-macosx_arm64, macosarch: arm64}, - {os: macos-latest, dist: cp312-macosx_arm64, macosarch: arm64}, - - # pypy OSX builds disabled because numpy isn't prebuilt and fails to build. - # - # The actual error seen in github actions: - # - # RuntimeError: Found /usr/lib/libcblas.dylib, but that file is a - # symbolic link to the MacOS Accelerate framework, which is not - # supported by NumPy. You must configure the build to use a - # different optimized library, or disable the use of optimized - # BLAS and LAPACK by setting the environment variables - # NPY_BLAS_ORDER="" and NPY_LAPACK_ORDER="" before building NumPy. - # - # {os: macOS-10.15, dist: pp37-macosx_x86_64}, - # {os: macOS-10.15, dist: pp38-macosx_x86_64}, - # {os: macOS-10.15, dist: pp39-macosx_x86_64}, - - {os: windows-2019, dist: cp36-win_amd64}, - {os: windows-2019, dist: cp37-win_amd64}, - {os: windows-2019, dist: cp38-win_amd64}, - {os: windows-2019, dist: cp39-win_amd64}, - {os: windows-2019, dist: cp310-win_amd64}, - {os: windows-2019, dist: cp311-win_amd64}, - {os: windows-2019, dist: cp312-win_amd64}, - - {os: windows-2019, dist: cp36-win32}, - {os: windows-2019, dist: cp37-win32}, - # cp38-win32 and cp39-win32 disabled because scipy fails to build. - # - # The actual error seen in github actions: - # - # Need python for 64-bit, but found 32-bit - # ..\..\meson.build:82:0: ERROR: Python dependency not found - # - #{os: windows-2019, dist: cp38-win32}, - #{os: windows-2019, dist: cp39-win32}, - - # cp310-win32 disabled because numpy isn't prebuilt and fails to build. - # - # The actual error seen in github actions: - # - # CCompiler_spawn() got an unexpected keyword argument 'env' - # - # {os: windows-2019, dist: cp310-win32}, - ] - env: - CIBW_BUILD: "${{ matrix.os_dist.dist }}" - CIBW_ARCHS_MACOS: "${{ matrix.os_dist.macosarch }}" - CIBW_TEST_REQUIRES: cirq-core pytest - CIBW_TEST_COMMAND: pytest {project}/src {project}/glue/cirq && stim help +# build_dist: +# runs-on: ${{ matrix.os_dist.os }} +# strategy: +# fail-fast: false +# matrix: +# os_dist: [ +# {os: ubuntu-latest, dist: cp36-manylinux_x86_64}, +# {os: ubuntu-latest, dist: cp37-manylinux_x86_64}, +# {os: ubuntu-latest, dist: cp38-manylinux_x86_64}, +# {os: ubuntu-latest, dist: cp39-manylinux_x86_64}, +# {os: ubuntu-latest, dist: cp310-manylinux_x86_64}, +# {os: ubuntu-latest, dist: cp311-manylinux_x86_64}, +# {os: ubuntu-latest, dist: cp312-manylinux_x86_64}, +# +# {os: ubuntu-latest, dist: cp36-manylinux_i686}, +# {os: ubuntu-latest, dist: cp37-manylinux_i686}, +# # cp38-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. +# # {os: ubuntu-latest, dist: cp38-manylinux_i686}, +# # cp39-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. +# # {os: ubuntu-latest, dist: cp39-manylinux_i686}, +# # cp310-manylinux_i686 disabled because scipy isn't prebuilt and fails to build. +# # +# # The actual error seen in github actions: +# # +# # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK +# # libraries found. To build Scipy from sources, BLAS & LAPACK +# # libraries need to be installed. +# # +# #{os: ubuntu-latest, dist: cp310-manylinux_i686}, +# +# # pypy manylinux builds disabled because scipy isn't prebuilt and fails to build. +# # +# # The actual error seen in github actions: +# # +# # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK +# # libraries found. To build Scipy from sources, BLAS & LAPACK +# # libraries need to be installed. +# # +# # {os: ubuntu-latest, dist: pp37-manylinux_x86_64}, +# # {os: ubuntu-latest, dist: pp38-manylinux_x86_64}, +# # {os: ubuntu-latest, dist: pp39-manylinux_x86_64}, +# # {os: ubuntu-latest, dist: pp37-manylinux_i686}, +# # {os: ubuntu-latest, dist: pp38-manylinux_i686}, +# # {os: ubuntu-latest, dist: pp39-manylinux_i686}, +# +# # musllinux builds disabled because scipy isn't prebuilt and fails to build. +# # +# # The actual error seen in github actions: +# # +# # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK +# # libraries found. To build Scipy from sources, BLAS & LAPACK +# # libraries need to be installed. +# # +# # {os: ubuntu-latest, dist: cp36-musllinux_x86_64}, +# # {os: ubuntu-latest, dist: cp37-musllinux_x86_64}, +# # {os: ubuntu-latest, dist: cp38-musllinux_x86_64}, +# # {os: ubuntu-latest, dist: cp39-musllinux_x86_64}, +# # {os: ubuntu-latest, dist: cp310-musllinux_x86_64}, +# # {os: ubuntu-latest, dist: cp36-musllinux_i686}, +# # {os: ubuntu-latest, dist: cp37-musllinux_i686}, +# # {os: ubuntu-latest, dist: cp38-musllinux_i686}, +# # {os: ubuntu-latest, dist: cp39-musllinux_i686}, +# # {os: ubuntu-latest, dist: cp310-musllinux_i686}, +# +# {os: macos-latest, dist: cp36-macosx_x86_64, macosarch: x86_64}, +# {os: macos-latest, dist: cp37-macosx_x86_64, macosarch: x86_64}, +# {os: macos-latest, dist: cp38-macosx_x86_64, macosarch: x86_64}, +# {os: macos-latest, dist: cp39-macosx_x86_64, macosarch: x86_64}, +# {os: macos-latest, dist: cp310-macosx_x86_64, macosarch: x86_64}, +# {os: macos-latest, dist: cp311-macosx_x86_64, macosarch: x86_64}, +# {os: macos-latest, dist: cp312-macosx_x86_64, macosarch: x86_64}, +# +# {os: macos-latest, dist: cp38-macosx_arm64, macosarch: arm64}, +# {os: macos-latest, dist: cp39-macosx_arm64, macosarch: arm64}, +# {os: macos-latest, dist: cp310-macosx_arm64, macosarch: arm64}, +# {os: macos-latest, dist: cp311-macosx_arm64, macosarch: arm64}, +# {os: macos-latest, dist: cp312-macosx_arm64, macosarch: arm64}, +# +# # pypy OSX builds disabled because numpy isn't prebuilt and fails to build. +# # +# # The actual error seen in github actions: +# # +# # RuntimeError: Found /usr/lib/libcblas.dylib, but that file is a +# # symbolic link to the MacOS Accelerate framework, which is not +# # supported by NumPy. You must configure the build to use a +# # different optimized library, or disable the use of optimized +# # BLAS and LAPACK by setting the environment variables +# # NPY_BLAS_ORDER="" and NPY_LAPACK_ORDER="" before building NumPy. +# # +# # {os: macOS-10.15, dist: pp37-macosx_x86_64}, +# # {os: macOS-10.15, dist: pp38-macosx_x86_64}, +# # {os: macOS-10.15, dist: pp39-macosx_x86_64}, +# +# {os: windows-2019, dist: cp36-win_amd64}, +# {os: windows-2019, dist: cp37-win_amd64}, +# {os: windows-2019, dist: cp38-win_amd64}, +# {os: windows-2019, dist: cp39-win_amd64}, +# {os: windows-2019, dist: cp310-win_amd64}, +# {os: windows-2019, dist: cp311-win_amd64}, +# {os: windows-2019, dist: cp312-win_amd64}, +# +# {os: windows-2019, dist: cp36-win32}, +# {os: windows-2019, dist: cp37-win32}, +# # cp38-win32 and cp39-win32 disabled because scipy fails to build. +# # +# # The actual error seen in github actions: +# # +# # Need python for 64-bit, but found 32-bit +# # ..\..\meson.build:82:0: ERROR: Python dependency not found +# # +# #{os: windows-2019, dist: cp38-win32}, +# #{os: windows-2019, dist: cp39-win32}, +# +# # cp310-win32 disabled because numpy isn't prebuilt and fails to build. +# # +# # The actual error seen in github actions: +# # +# # CCompiler_spawn() got an unexpected keyword argument 'env' +# # +# # {os: windows-2019, dist: cp310-win32}, +# ] +# env: +# CIBW_BUILD: "${{ matrix.os_dist.dist }}" +# CIBW_ARCHS_MACOS: "${{ matrix.os_dist.macosarch }}" +# CIBW_TEST_REQUIRES: cirq-core pytest +# CIBW_TEST_COMMAND: pytest {project}/src {project}/glue/cirq && stim help +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - run: python dev/overwrite_dev_versions_with_date.py +# - run: mkdir -p output/stim +# - run: mkdir -p output/stimcirq +# - run: mkdir -p output/sinter +# - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel +# - run: python -m cibuildwheel --print-build-identifiers +# - run: python -m cibuildwheel --output-dir output/stim +# - run: python setup.py sdist +# - run: cd glue/cirq && python setup.py sdist +# - run: cd glue/sample && python setup.py sdist +# - run: mv dist/* output/stim +# - run: mv glue/cirq/dist/* output/stimcirq +# - run: mv glue/sample/dist/* output/sinter +# - uses: actions/upload-artifact@v4.4.0 +# with: +# name: "dist-${{ matrix.os_dist.os }}-${{ matrix.os_dist.dist }}-${{ matrix.os_dist.macosarch }}" +# path: | +# ./output/stimcirq/*.tar.gz +# ./output/sinter/*.tar.gz +# ./output/stim/* + build_sdist: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 @@ -167,21 +191,26 @@ jobs: - run: mv glue/sample/dist/* output/sinter - uses: actions/upload-artifact@v4.4.0 with: - name: "dist-${{ matrix.os_dist.os }}-${{ matrix.os_dist.dist }}-${{ matrix.os_dist.macosarch }}" - path: | - ./output/stimcirq/*.tar.gz - ./output/sinter/*.tar.gz - ./output/stim/* - check_sdist_installs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel - - run: python setup.py sdist - - run: pip install dist/*.tar.gz + name: "dist-src-sinter" + path: ./output/sinter/*.tar.gz + - uses: actions/upload-artifact@v4.4.0 + with: + name: "dist-src-stimcirq" + path: ./output/stimcirq/*.tar.gz + - uses: actions/upload-artifact@v4.4.0 + with: + name: "dist-src-stim" + path: ./output/stim/* +# check_sdist_installs: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel +# - run: python setup.py sdist +# - run: pip install dist/*.tar.gz merge_upload_artifacts: - needs: ["build_dist"] + needs: ["build_dist", "build_sdist"] runs-on: ubuntu-latest steps: - name: Merge Artifacts @@ -189,260 +218,260 @@ jobs: with: name: dist pattern: dist-* - upload_dev_release_to_pypi: - needs: ["merge_upload_artifacts"] - if: github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v4.1.7 - with: - name: dist - path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - packages_dir: dist/stim/ - password: ${{ secrets.pypi_token_stim }} - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - packages_dir: dist/stimcirq/ - password: ${{ secrets.pypi_token_stimcirq }} - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - packages_dir: dist/sinter/ - password: ${{ secrets.pypi_token_sinter }} - run_main: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: cmake . - - run: make stim -j 2 - - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | out/stim --sample - build_bazel: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - bazelisk-version: 1.x - - run: bazel build :all - - run: bazel test :stim_test - build_clang: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v1 - - run: | - cd .. - git clone https://github.com/google/googletest.git -b release-1.12.1 - mkdir googletest/build && cd googletest/build - cmake .. -DBUILD_GMOCK=OFF - make - sudo make install - - uses: egor-tensin/setup-clang@v1 - with: - version: latest - platform: x64 - - run: cmake . -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ - - run: cmake --build . - build_lib: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: cmake . - - run: make libstim -j 2 - - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc - - run: g++ -std=c++20 test.cc out/libstim.a -I src - - run: ./a.out test - build_lib_install: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: mkdir install_dir - - run: cmake . -DCMAKE_INSTALL_PREFIX=install_dir - - run: make -j 2 - - run: make install - - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc - - run: g++ -std=c++20 test.cc install_dir/lib/libstim.a -I install_dir/include - - run: ./a.out test - - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | install_dir/bin/stim --sample - benchmark_windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - - uses: microsoft/setup-msbuild@v1.0.2 - - run: cmake . - - run: MSBuild.exe stim_perf.vcxproj /p:Configuration=Release /p:OutDir=msbuild_out /p:O=2 - - run: msbuild_out/stim_perf.exe - benchmark: - runs-on: ubuntu-latest - strategy: - matrix: - simd_width: [64, 128, 256] - steps: - - uses: actions/checkout@v1 - - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} - - run: make stim_perf -j 2 - - run: out/stim_perf - test: - runs-on: ubuntu-latest - strategy: - matrix: - simd_width: [64, 128, 256] - steps: - - uses: actions/checkout@v1 - - run: | - cd .. - git clone https://github.com/google/googletest.git -b release-1.12.1 - mkdir googletest/build && cd googletest/build - cmake .. -DBUILD_GMOCK=OFF - make - sudo make install - - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} - - run: make stim_test -j 2 - - run: out/stim_test - test_o3: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: | - cd .. - git clone https://github.com/google/googletest.git -b release-1.12.1 - mkdir googletest/build && cd googletest/build - cmake .. -DBUILD_GMOCK=OFF - make - sudo make install - - run: cmake . -DSIMD_WIDTH=256 - - run: make stim_test_o3 -j 2 - - run: out/stim_test_o3 - test_generated_docs_are_fresh: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - bazelisk-version: 1.x - - uses: actions/setup-node@v1 - with: - node-version: 16.x - - run: bazel build :stim_dev_wheel - - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl - - run: diff <(python dev/gen_stim_api_reference.py -dev) doc/python_api_reference_vDev.md - - run: diff <(python dev/gen_stim_stub_file.py -dev) glue/python/src/stim/__init__.pyi - - run: diff <(python dev/gen_stim_stub_file.py -dev) doc/stim.pyi - - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'gates_markdown'])") doc/gates.md - - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'formats_markdown'])") doc/result_formats.md - - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'commands_markdown'])") doc/usage_command_line.md - - run: diff <(dev/gen_known_gates_for_js.sh) glue/crumble/test/generated_gate_name_list.test.js - - run: python doc/stim.pyi - - run: npm install -g rollup@3.21.2 uglify-js@3.17.4 - - run: diff <(dev/compile_crumble_into_cpp_string_file.sh) src/stim/diagram/crumble_data.cc - - run: pip install -e glue/sample - - run: diff <(python dev/gen_sinter_api_reference.py -dev) doc/sinter_api.md - test_generated_file_lists_are_fresh: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: dev/regen_file_lists.sh /tmp - - run: diff /tmp/perf_files file_lists/perf_files - - run: diff /tmp/pybind_files file_lists/pybind_files - - run: diff /tmp/source_files_no_main file_lists/source_files_no_main - - run: diff /tmp/test_files file_lists/test_files - test_pybind: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - bazelisk-version: 1.x - - run: bazel build :stim_dev_wheel - - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl - - run: pip install pytest - - run: pytest src - - run: dev/doctest_proper.py --module stim - test_stimcirq: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - bazelisk-version: 1.x - - run: bazel build :stim_dev_wheel - - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl - - run: pip install -e glue/cirq - - run: pip install pytest - - run: pytest glue/cirq - - run: dev/doctest_proper.py --module stimcirq --import cirq sympy - test_sinter: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - bazelisk-version: 1.x - - run: bazel build :stim_dev_wheel - - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl - - run: pip install -e glue/sample - - run: pip install pytest pymatching fusion-blossom~=0.1.4 - - run: pytest glue/sample - - run: dev/doctest_proper.py --module sinter - - run: sinter help - test_stimzx: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: bazel-contrib/setup-bazel@0.8.5 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - bazelisk-version: 1.x - - run: bazel build :stim_dev_wheel - - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl - - run: pip install -e glue/zx - - run: pip install pytest - - run: pytest glue/zx - - run: dev/doctest_proper.py --module stimzx - test_stimjs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: mymindstorm/setup-emsdk@v14 - with: - version: 2.0.18 - actions-cache-folder: 'emsdk-cache' - - uses: actions/setup-node@v1 - with: - node-version: 16.x - - run: npm install - - run: bash glue/javascript/build_wasm.sh - - run: node puppeteer_run_tests.js - test_crumble: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: node glue/crumble/run_tests_headless.js +# upload_dev_release_to_pypi: +# needs: ["merge_upload_artifacts"] +# if: github.ref == 'refs/heads/main' +# runs-on: ubuntu-latest +# steps: +# - uses: actions/download-artifact@v4.1.7 +# with: +# name: dist +# path: dist +# - uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# user: __token__ +# packages_dir: dist/stim/ +# password: ${{ secrets.pypi_token_stim }} +# - uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# user: __token__ +# packages_dir: dist/stimcirq/ +# password: ${{ secrets.pypi_token_stimcirq }} +# - uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# user: __token__ +# packages_dir: dist/sinter/ +# password: ${{ secrets.pypi_token_sinter }} +# run_main: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - run: cmake . +# - run: make stim -j 2 +# - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | out/stim --sample +# build_bazel: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - uses: bazel-contrib/setup-bazel@0.8.5 +# with: +# bazelisk-cache: true +# disk-cache: ${{ github.workflow }} +# repository-cache: true +# bazelisk-version: 1.x +# - run: bazel build :all +# - run: bazel test :stim_test +# build_clang: +# runs-on: ubuntu-20.04 +# steps: +# - uses: actions/checkout@v1 +# - run: | +# cd .. +# git clone https://github.com/google/googletest.git -b release-1.12.1 +# mkdir googletest/build && cd googletest/build +# cmake .. -DBUILD_GMOCK=OFF +# make +# sudo make install +# - uses: egor-tensin/setup-clang@v1 +# with: +# version: latest +# platform: x64 +# - run: cmake . -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ +# - run: cmake --build . +# build_lib: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - run: cmake . +# - run: make libstim -j 2 +# - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc +# - run: g++ -std=c++20 test.cc out/libstim.a -I src +# - run: ./a.out test +# build_lib_install: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - run: mkdir install_dir +# - run: cmake . -DCMAKE_INSTALL_PREFIX=install_dir +# - run: make -j 2 +# - run: make install +# - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc +# - run: g++ -std=c++20 test.cc install_dir/lib/libstim.a -I install_dir/include +# - run: ./a.out test +# - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | install_dir/bin/stim --sample +# benchmark_windows: +# runs-on: windows-latest +# steps: +# - uses: actions/checkout@v1 +# - uses: microsoft/setup-msbuild@v1.0.2 +# - run: cmake . +# - run: MSBuild.exe stim_perf.vcxproj /p:Configuration=Release /p:OutDir=msbuild_out /p:O=2 +# - run: msbuild_out/stim_perf.exe +# benchmark: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# simd_width: [64, 128, 256] +# steps: +# - uses: actions/checkout@v1 +# - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} +# - run: make stim_perf -j 2 +# - run: out/stim_perf +# test: +# runs-on: ubuntu-latest +# strategy: +# matrix: +# simd_width: [64, 128, 256] +# steps: +# - uses: actions/checkout@v1 +# - run: | +# cd .. +# git clone https://github.com/google/googletest.git -b release-1.12.1 +# mkdir googletest/build && cd googletest/build +# cmake .. -DBUILD_GMOCK=OFF +# make +# sudo make install +# - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} +# - run: make stim_test -j 2 +# - run: out/stim_test +# test_o3: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - run: | +# cd .. +# git clone https://github.com/google/googletest.git -b release-1.12.1 +# mkdir googletest/build && cd googletest/build +# cmake .. -DBUILD_GMOCK=OFF +# make +# sudo make install +# - run: cmake . -DSIMD_WIDTH=256 +# - run: make stim_test_o3 -j 2 +# - run: out/stim_test_o3 +# test_generated_docs_are_fresh: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - uses: bazel-contrib/setup-bazel@0.8.5 +# with: +# bazelisk-cache: true +# disk-cache: ${{ github.workflow }} +# repository-cache: true +# bazelisk-version: 1.x +# - uses: actions/setup-node@v1 +# with: +# node-version: 16.x +# - run: bazel build :stim_dev_wheel +# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl +# - run: diff <(python dev/gen_stim_api_reference.py -dev) doc/python_api_reference_vDev.md +# - run: diff <(python dev/gen_stim_stub_file.py -dev) glue/python/src/stim/__init__.pyi +# - run: diff <(python dev/gen_stim_stub_file.py -dev) doc/stim.pyi +# - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'gates_markdown'])") doc/gates.md +# - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'formats_markdown'])") doc/result_formats.md +# - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'commands_markdown'])") doc/usage_command_line.md +# - run: diff <(dev/gen_known_gates_for_js.sh) glue/crumble/test/generated_gate_name_list.test.js +# - run: python doc/stim.pyi +# - run: npm install -g rollup@3.21.2 uglify-js@3.17.4 +# - run: diff <(dev/compile_crumble_into_cpp_string_file.sh) src/stim/diagram/crumble_data.cc +# - run: pip install -e glue/sample +# - run: diff <(python dev/gen_sinter_api_reference.py -dev) doc/sinter_api.md +# test_generated_file_lists_are_fresh: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - run: dev/regen_file_lists.sh /tmp +# - run: diff /tmp/perf_files file_lists/perf_files +# - run: diff /tmp/pybind_files file_lists/pybind_files +# - run: diff /tmp/source_files_no_main file_lists/source_files_no_main +# - run: diff /tmp/test_files file_lists/test_files +# test_pybind: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - uses: bazel-contrib/setup-bazel@0.8.5 +# with: +# bazelisk-cache: true +# disk-cache: ${{ github.workflow }} +# repository-cache: true +# bazelisk-version: 1.x +# - run: bazel build :stim_dev_wheel +# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl +# - run: pip install pytest +# - run: pytest src +# - run: dev/doctest_proper.py --module stim +# test_stimcirq: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - uses: bazel-contrib/setup-bazel@0.8.5 +# with: +# bazelisk-cache: true +# disk-cache: ${{ github.workflow }} +# repository-cache: true +# bazelisk-version: 1.x +# - run: bazel build :stim_dev_wheel +# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl +# - run: pip install -e glue/cirq +# - run: pip install pytest +# - run: pytest glue/cirq +# - run: dev/doctest_proper.py --module stimcirq --import cirq sympy +# test_sinter: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - uses: bazel-contrib/setup-bazel@0.8.5 +# with: +# bazelisk-cache: true +# disk-cache: ${{ github.workflow }} +# repository-cache: true +# bazelisk-version: 1.x +# - run: bazel build :stim_dev_wheel +# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl +# - run: pip install -e glue/sample +# - run: pip install pytest pymatching fusion-blossom~=0.1.4 +# - run: pytest glue/sample +# - run: dev/doctest_proper.py --module sinter +# - run: sinter help +# test_stimzx: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v3 +# - uses: bazel-contrib/setup-bazel@0.8.5 +# with: +# bazelisk-cache: true +# disk-cache: ${{ github.workflow }} +# repository-cache: true +# bazelisk-version: 1.x +# - run: bazel build :stim_dev_wheel +# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl +# - run: pip install -e glue/zx +# - run: pip install pytest +# - run: pytest glue/zx +# - run: dev/doctest_proper.py --module stimzx +# test_stimjs: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: mymindstorm/setup-emsdk@v14 +# with: +# version: 2.0.18 +# actions-cache-folder: 'emsdk-cache' +# - uses: actions/setup-node@v1 +# with: +# node-version: 16.x +# - run: npm install +# - run: bash glue/javascript/build_wasm.sh +# - run: node puppeteer_run_tests.js +# test_crumble: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 16 +# - run: node glue/crumble/run_tests_headless.js From 07000ed53d5347697a7e917552839c2d27a5692e Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 15:42:14 -0700 Subject: [PATCH 02/11] ru --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e9d2554..61c905ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -173,6 +173,7 @@ jobs: # ./output/sinter/*.tar.gz # ./output/stim/* build_sdist: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 From 5943e214779e0e78ac566dc6532a5c36a887878d Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 15:46:56 -0700 Subject: [PATCH 03/11] x --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61c905ef..e6fe67c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -211,7 +211,7 @@ jobs: # - run: python setup.py sdist # - run: pip install dist/*.tar.gz merge_upload_artifacts: - needs: ["build_dist", "build_sdist"] + needs: ["build_sdist"] runs-on: ubuntu-latest steps: - name: Merge Artifacts From b739bce314ef1e0a8a8de76f23cb1bcbe10c64cd Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 16:27:11 -0700 Subject: [PATCH 04/11] just one actually --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6fe67c0..3a986014 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,7 +183,6 @@ jobs: - run: mkdir -p output/sinter - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel - run: python -m cibuildwheel --print-build-identifiers - - run: python -m cibuildwheel --output-dir output/stim - run: python setup.py sdist - run: cd glue/cirq && python setup.py sdist - run: cd glue/sample && python setup.py sdist From 7b5403dfd0c7bffc487a7b1623a2e6435381697e Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 17:37:45 -0700 Subject: [PATCH 05/11] manifest --- .github/workflows/ci.yml | 16 +++++----------- glue/sample/MANIFEST.in | 1 + 2 files changed, 6 insertions(+), 11 deletions(-) create mode 100644 glue/sample/MANIFEST.in diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a986014..b1d21096 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,30 +177,24 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 + - run: python -m pip install setuptools - run: python dev/overwrite_dev_versions_with_date.py - - run: mkdir -p output/stim - - run: mkdir -p output/stimcirq - - run: mkdir -p output/sinter - - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel - - run: python -m cibuildwheel --print-build-identifiers + - run: mkdir output - run: python setup.py sdist - run: cd glue/cirq && python setup.py sdist - run: cd glue/sample && python setup.py sdist - - run: mv dist/* output/stim - - run: mv glue/cirq/dist/* output/stimcirq - - run: mv glue/sample/dist/* output/sinter - uses: actions/upload-artifact@v4.4.0 with: name: "dist-src-sinter" - path: ./output/sinter/*.tar.gz + path: glue/sample/dist/*.tar.gz - uses: actions/upload-artifact@v4.4.0 with: name: "dist-src-stimcirq" - path: ./output/stimcirq/*.tar.gz + path: glue/cirq/dist/*.tar.gz - uses: actions/upload-artifact@v4.4.0 with: name: "dist-src-stim" - path: ./output/stim/* + path: dist/*.tar.gz # check_sdist_installs: # runs-on: ubuntu-latest # steps: diff --git a/glue/sample/MANIFEST.in b/glue/sample/MANIFEST.in new file mode 100644 index 00000000..bffd8bc6 --- /dev/null +++ b/glue/sample/MANIFEST.in @@ -0,0 +1 @@ +recursive-include src *.py From b142d7c8c0d79d98a43f18cc7549232eeb6808cb Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 17:39:47 -0700 Subject: [PATCH 06/11] pb --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1d21096..2bd24bee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,7 +177,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v3 - - run: python -m pip install setuptools + - run: python -m pip install setuptools pybind11~=2.11.1 - run: python dev/overwrite_dev_versions_with_date.py - run: mkdir output - run: python setup.py sdist From f7a4c8af1efc56339c18a81a9490f21fb791c7e1 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 17:46:35 -0700 Subject: [PATCH 07/11] resto --- .github/workflows/ci.yml | 66 ++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bd24bee..1d0dfe3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,13 @@ on: branches: - main jobs: -# build_dist: -# runs-on: ${{ matrix.os_dist.os }} -# strategy: -# fail-fast: false -# matrix: -# os_dist: [ -# {os: ubuntu-latest, dist: cp36-manylinux_x86_64}, + build_dist: + runs-on: ${{ matrix.os_dist.os }} + strategy: + fail-fast: false + matrix: + os_dist: [ + {os: ubuntu-latest, dist: cp36-manylinux_x86_64}, # {os: ubuntu-latest, dist: cp37-manylinux_x86_64}, # {os: ubuntu-latest, dist: cp38-manylinux_x86_64}, # {os: ubuntu-latest, dist: cp39-manylinux_x86_64}, @@ -143,35 +143,23 @@ jobs: # # CCompiler_spawn() got an unexpected keyword argument 'env' # # # # {os: windows-2019, dist: cp310-win32}, -# ] -# env: -# CIBW_BUILD: "${{ matrix.os_dist.dist }}" -# CIBW_ARCHS_MACOS: "${{ matrix.os_dist.macosarch }}" -# CIBW_TEST_REQUIRES: cirq-core pytest -# CIBW_TEST_COMMAND: pytest {project}/src {project}/glue/cirq && stim help -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - run: python dev/overwrite_dev_versions_with_date.py -# - run: mkdir -p output/stim -# - run: mkdir -p output/stimcirq -# - run: mkdir -p output/sinter -# - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel -# - run: python -m cibuildwheel --print-build-identifiers -# - run: python -m cibuildwheel --output-dir output/stim -# - run: python setup.py sdist -# - run: cd glue/cirq && python setup.py sdist -# - run: cd glue/sample && python setup.py sdist -# - run: mv dist/* output/stim -# - run: mv glue/cirq/dist/* output/stimcirq -# - run: mv glue/sample/dist/* output/sinter -# - uses: actions/upload-artifact@v4.4.0 -# with: -# name: "dist-${{ matrix.os_dist.os }}-${{ matrix.os_dist.dist }}-${{ matrix.os_dist.macosarch }}" -# path: | -# ./output/stimcirq/*.tar.gz -# ./output/sinter/*.tar.gz -# ./output/stim/* + ] + env: + CIBW_BUILD: "${{ matrix.os_dist.dist }}" + CIBW_ARCHS_MACOS: "${{ matrix.os_dist.macosarch }}" + CIBW_TEST_REQUIRES: cirq-core pytest + CIBW_TEST_COMMAND: pytest {project}/src {project}/glue/cirq && stim help + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - run: python dev/overwrite_dev_versions_with_date.py + - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel + - run: python -m cibuildwheel --print-build-identifiers + - run: python -m cibuildwheel --output-dir output/stim + - uses: actions/upload-artifact@v4.4.0 + with: + name: "dist-${{ matrix.os_dist.os }}-${{ matrix.os_dist.dist }}-${{ matrix.os_dist.macosarch }}" + path: dist/* build_sdist: runs-on: ubuntu-latest steps: @@ -185,15 +173,15 @@ jobs: - run: cd glue/sample && python setup.py sdist - uses: actions/upload-artifact@v4.4.0 with: - name: "dist-src-sinter" + name: "dist-sdist-sinter" path: glue/sample/dist/*.tar.gz - uses: actions/upload-artifact@v4.4.0 with: - name: "dist-src-stimcirq" + name: "dist-sdist-stimcirq" path: glue/cirq/dist/*.tar.gz - uses: actions/upload-artifact@v4.4.0 with: - name: "dist-src-stim" + name: "dist-sdist-stim" path: dist/*.tar.gz # check_sdist_installs: # runs-on: ubuntu-latest From 588446650766186626f78f9b1916c0864e437e56 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 20:16:59 -0700 Subject: [PATCH 08/11] d --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d0dfe3f..63a04dd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,7 +192,7 @@ jobs: # - run: python setup.py sdist # - run: pip install dist/*.tar.gz merge_upload_artifacts: - needs: ["build_sdist"] + needs: ["build_dist", "build_sdist"] runs-on: ubuntu-latest steps: - name: Merge Artifacts From 1629b60b547b3c5b33bd211798a1d1e0677336b4 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 21:24:31 -0700 Subject: [PATCH 09/11] x --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63a04dd1..99656142 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,7 +155,7 @@ jobs: - run: python dev/overwrite_dev_versions_with_date.py - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel - run: python -m cibuildwheel --print-build-identifiers - - run: python -m cibuildwheel --output-dir output/stim + - run: python -m cibuildwheel --output-dir dist - uses: actions/upload-artifact@v4.4.0 with: name: "dist-${{ matrix.os_dist.os }}-${{ matrix.os_dist.dist }}-${{ matrix.os_dist.macosarch }}" From 2becaa0a1b3606ec82dc1c59a98317f301541c86 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 22:06:13 -0700 Subject: [PATCH 10/11] restore --- .github/workflows/ci.yml | 226 +++++++++++++++++++-------------------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99656142..e8ee4f9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,119 +30,119 @@ jobs: matrix: os_dist: [ {os: ubuntu-latest, dist: cp36-manylinux_x86_64}, -# {os: ubuntu-latest, dist: cp37-manylinux_x86_64}, -# {os: ubuntu-latest, dist: cp38-manylinux_x86_64}, -# {os: ubuntu-latest, dist: cp39-manylinux_x86_64}, -# {os: ubuntu-latest, dist: cp310-manylinux_x86_64}, -# {os: ubuntu-latest, dist: cp311-manylinux_x86_64}, -# {os: ubuntu-latest, dist: cp312-manylinux_x86_64}, -# -# {os: ubuntu-latest, dist: cp36-manylinux_i686}, -# {os: ubuntu-latest, dist: cp37-manylinux_i686}, -# # cp38-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. -# # {os: ubuntu-latest, dist: cp38-manylinux_i686}, -# # cp39-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. -# # {os: ubuntu-latest, dist: cp39-manylinux_i686}, -# # cp310-manylinux_i686 disabled because scipy isn't prebuilt and fails to build. -# # -# # The actual error seen in github actions: -# # -# # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK -# # libraries found. To build Scipy from sources, BLAS & LAPACK -# # libraries need to be installed. -# # -# #{os: ubuntu-latest, dist: cp310-manylinux_i686}, -# -# # pypy manylinux builds disabled because scipy isn't prebuilt and fails to build. -# # -# # The actual error seen in github actions: -# # -# # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK -# # libraries found. To build Scipy from sources, BLAS & LAPACK -# # libraries need to be installed. -# # -# # {os: ubuntu-latest, dist: pp37-manylinux_x86_64}, -# # {os: ubuntu-latest, dist: pp38-manylinux_x86_64}, -# # {os: ubuntu-latest, dist: pp39-manylinux_x86_64}, -# # {os: ubuntu-latest, dist: pp37-manylinux_i686}, -# # {os: ubuntu-latest, dist: pp38-manylinux_i686}, -# # {os: ubuntu-latest, dist: pp39-manylinux_i686}, -# -# # musllinux builds disabled because scipy isn't prebuilt and fails to build. -# # -# # The actual error seen in github actions: -# # -# # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK -# # libraries found. To build Scipy from sources, BLAS & LAPACK -# # libraries need to be installed. -# # -# # {os: ubuntu-latest, dist: cp36-musllinux_x86_64}, -# # {os: ubuntu-latest, dist: cp37-musllinux_x86_64}, -# # {os: ubuntu-latest, dist: cp38-musllinux_x86_64}, -# # {os: ubuntu-latest, dist: cp39-musllinux_x86_64}, -# # {os: ubuntu-latest, dist: cp310-musllinux_x86_64}, -# # {os: ubuntu-latest, dist: cp36-musllinux_i686}, -# # {os: ubuntu-latest, dist: cp37-musllinux_i686}, -# # {os: ubuntu-latest, dist: cp38-musllinux_i686}, -# # {os: ubuntu-latest, dist: cp39-musllinux_i686}, -# # {os: ubuntu-latest, dist: cp310-musllinux_i686}, -# -# {os: macos-latest, dist: cp36-macosx_x86_64, macosarch: x86_64}, -# {os: macos-latest, dist: cp37-macosx_x86_64, macosarch: x86_64}, -# {os: macos-latest, dist: cp38-macosx_x86_64, macosarch: x86_64}, -# {os: macos-latest, dist: cp39-macosx_x86_64, macosarch: x86_64}, -# {os: macos-latest, dist: cp310-macosx_x86_64, macosarch: x86_64}, -# {os: macos-latest, dist: cp311-macosx_x86_64, macosarch: x86_64}, -# {os: macos-latest, dist: cp312-macosx_x86_64, macosarch: x86_64}, -# -# {os: macos-latest, dist: cp38-macosx_arm64, macosarch: arm64}, -# {os: macos-latest, dist: cp39-macosx_arm64, macosarch: arm64}, -# {os: macos-latest, dist: cp310-macosx_arm64, macosarch: arm64}, -# {os: macos-latest, dist: cp311-macosx_arm64, macosarch: arm64}, -# {os: macos-latest, dist: cp312-macosx_arm64, macosarch: arm64}, -# -# # pypy OSX builds disabled because numpy isn't prebuilt and fails to build. -# # -# # The actual error seen in github actions: -# # -# # RuntimeError: Found /usr/lib/libcblas.dylib, but that file is a -# # symbolic link to the MacOS Accelerate framework, which is not -# # supported by NumPy. You must configure the build to use a -# # different optimized library, or disable the use of optimized -# # BLAS and LAPACK by setting the environment variables -# # NPY_BLAS_ORDER="" and NPY_LAPACK_ORDER="" before building NumPy. -# # -# # {os: macOS-10.15, dist: pp37-macosx_x86_64}, -# # {os: macOS-10.15, dist: pp38-macosx_x86_64}, -# # {os: macOS-10.15, dist: pp39-macosx_x86_64}, -# -# {os: windows-2019, dist: cp36-win_amd64}, -# {os: windows-2019, dist: cp37-win_amd64}, -# {os: windows-2019, dist: cp38-win_amd64}, -# {os: windows-2019, dist: cp39-win_amd64}, -# {os: windows-2019, dist: cp310-win_amd64}, -# {os: windows-2019, dist: cp311-win_amd64}, -# {os: windows-2019, dist: cp312-win_amd64}, -# -# {os: windows-2019, dist: cp36-win32}, -# {os: windows-2019, dist: cp37-win32}, -# # cp38-win32 and cp39-win32 disabled because scipy fails to build. -# # -# # The actual error seen in github actions: -# # -# # Need python for 64-bit, but found 32-bit -# # ..\..\meson.build:82:0: ERROR: Python dependency not found -# # -# #{os: windows-2019, dist: cp38-win32}, -# #{os: windows-2019, dist: cp39-win32}, -# -# # cp310-win32 disabled because numpy isn't prebuilt and fails to build. -# # -# # The actual error seen in github actions: -# # -# # CCompiler_spawn() got an unexpected keyword argument 'env' -# # -# # {os: windows-2019, dist: cp310-win32}, + {os: ubuntu-latest, dist: cp37-manylinux_x86_64}, + {os: ubuntu-latest, dist: cp38-manylinux_x86_64}, + {os: ubuntu-latest, dist: cp39-manylinux_x86_64}, + {os: ubuntu-latest, dist: cp310-manylinux_x86_64}, + {os: ubuntu-latest, dist: cp311-manylinux_x86_64}, + {os: ubuntu-latest, dist: cp312-manylinux_x86_64}, + + {os: ubuntu-latest, dist: cp36-manylinux_i686}, + {os: ubuntu-latest, dist: cp37-manylinux_i686}, + # cp38-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. + # {os: ubuntu-latest, dist: cp38-manylinux_i686}, + # cp39-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. + # {os: ubuntu-latest, dist: cp39-manylinux_i686}, + # cp310-manylinux_i686 disabled because scipy isn't prebuilt and fails to build. + # + # The actual error seen in github actions: + # + # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK + # libraries found. To build Scipy from sources, BLAS & LAPACK + # libraries need to be installed. + # + #{os: ubuntu-latest, dist: cp310-manylinux_i686}, + + # pypy manylinux builds disabled because scipy isn't prebuilt and fails to build. + # + # The actual error seen in github actions: + # + # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK + # libraries found. To build Scipy from sources, BLAS & LAPACK + # libraries need to be installed. + # + # {os: ubuntu-latest, dist: pp37-manylinux_x86_64}, + # {os: ubuntu-latest, dist: pp38-manylinux_x86_64}, + # {os: ubuntu-latest, dist: pp39-manylinux_x86_64}, + # {os: ubuntu-latest, dist: pp37-manylinux_i686}, + # {os: ubuntu-latest, dist: pp38-manylinux_i686}, + # {os: ubuntu-latest, dist: pp39-manylinux_i686}, + + # musllinux builds disabled because scipy isn't prebuilt and fails to build. + # + # The actual error seen in github actions: + # + # numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK + # libraries found. To build Scipy from sources, BLAS & LAPACK + # libraries need to be installed. + # + # {os: ubuntu-latest, dist: cp36-musllinux_x86_64}, + # {os: ubuntu-latest, dist: cp37-musllinux_x86_64}, + # {os: ubuntu-latest, dist: cp38-musllinux_x86_64}, + # {os: ubuntu-latest, dist: cp39-musllinux_x86_64}, + # {os: ubuntu-latest, dist: cp310-musllinux_x86_64}, + # {os: ubuntu-latest, dist: cp36-musllinux_i686}, + # {os: ubuntu-latest, dist: cp37-musllinux_i686}, + # {os: ubuntu-latest, dist: cp38-musllinux_i686}, + # {os: ubuntu-latest, dist: cp39-musllinux_i686}, + # {os: ubuntu-latest, dist: cp310-musllinux_i686}, + + {os: macos-latest, dist: cp36-macosx_x86_64, macosarch: x86_64}, + {os: macos-latest, dist: cp37-macosx_x86_64, macosarch: x86_64}, + {os: macos-latest, dist: cp38-macosx_x86_64, macosarch: x86_64}, + {os: macos-latest, dist: cp39-macosx_x86_64, macosarch: x86_64}, + {os: macos-latest, dist: cp310-macosx_x86_64, macosarch: x86_64}, + {os: macos-latest, dist: cp311-macosx_x86_64, macosarch: x86_64}, + {os: macos-latest, dist: cp312-macosx_x86_64, macosarch: x86_64}, + + {os: macos-latest, dist: cp38-macosx_arm64, macosarch: arm64}, + {os: macos-latest, dist: cp39-macosx_arm64, macosarch: arm64}, + {os: macos-latest, dist: cp310-macosx_arm64, macosarch: arm64}, + {os: macos-latest, dist: cp311-macosx_arm64, macosarch: arm64}, + {os: macos-latest, dist: cp312-macosx_arm64, macosarch: arm64}, + + # pypy OSX builds disabled because numpy isn't prebuilt and fails to build. + # + # The actual error seen in github actions: + # + # RuntimeError: Found /usr/lib/libcblas.dylib, but that file is a + # symbolic link to the MacOS Accelerate framework, which is not + # supported by NumPy. You must configure the build to use a + # different optimized library, or disable the use of optimized + # BLAS and LAPACK by setting the environment variables + # NPY_BLAS_ORDER="" and NPY_LAPACK_ORDER="" before building NumPy. + # + # {os: macOS-10.15, dist: pp37-macosx_x86_64}, + # {os: macOS-10.15, dist: pp38-macosx_x86_64}, + # {os: macOS-10.15, dist: pp39-macosx_x86_64}, + + {os: windows-2019, dist: cp36-win_amd64}, + {os: windows-2019, dist: cp37-win_amd64}, + {os: windows-2019, dist: cp38-win_amd64}, + {os: windows-2019, dist: cp39-win_amd64}, + {os: windows-2019, dist: cp310-win_amd64}, + {os: windows-2019, dist: cp311-win_amd64}, + {os: windows-2019, dist: cp312-win_amd64}, + + {os: windows-2019, dist: cp36-win32}, + {os: windows-2019, dist: cp37-win32}, + # cp38-win32 and cp39-win32 disabled because scipy fails to build. + # + # The actual error seen in github actions: + # + # Need python for 64-bit, but found 32-bit + # ..\..\meson.build:82:0: ERROR: Python dependency not found + # + #{os: windows-2019, dist: cp38-win32}, + #{os: windows-2019, dist: cp39-win32}, + + # cp310-win32 disabled because numpy isn't prebuilt and fails to build. + # + # The actual error seen in github actions: + # + # CCompiler_spawn() got an unexpected keyword argument 'env' + # + # {os: windows-2019, dist: cp310-win32}, ] env: CIBW_BUILD: "${{ matrix.os_dist.dist }}" From 7e522adbcf73b4518f40f5f91099d7b07557f8a8 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 10 Sep 2024 23:55:36 -0700 Subject: [PATCH 11/11] restore all checks --- .github/workflows/ci.yml | 530 +++++++++++++++++++-------------------- 1 file changed, 265 insertions(+), 265 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8ee4f9d..0dee1932 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,14 +183,14 @@ jobs: with: name: "dist-sdist-stim" path: dist/*.tar.gz -# check_sdist_installs: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel -# - run: python setup.py sdist -# - run: pip install dist/*.tar.gz + check_sdist_installs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - run: python -m pip install pybind11~=2.11.1 cibuildwheel~=2.16.2 setuptools wheel + - run: python setup.py sdist + - run: pip install dist/*.tar.gz merge_upload_artifacts: needs: ["build_dist", "build_sdist"] runs-on: ubuntu-latest @@ -200,260 +200,260 @@ jobs: with: name: dist pattern: dist-* -# upload_dev_release_to_pypi: -# needs: ["merge_upload_artifacts"] -# if: github.ref == 'refs/heads/main' -# runs-on: ubuntu-latest -# steps: -# - uses: actions/download-artifact@v4.1.7 -# with: -# name: dist -# path: dist -# - uses: pypa/gh-action-pypi-publish@release/v1 -# with: -# user: __token__ -# packages_dir: dist/stim/ -# password: ${{ secrets.pypi_token_stim }} -# - uses: pypa/gh-action-pypi-publish@release/v1 -# with: -# user: __token__ -# packages_dir: dist/stimcirq/ -# password: ${{ secrets.pypi_token_stimcirq }} -# - uses: pypa/gh-action-pypi-publish@release/v1 -# with: -# user: __token__ -# packages_dir: dist/sinter/ -# password: ${{ secrets.pypi_token_sinter }} -# run_main: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v1 -# - run: cmake . -# - run: make stim -j 2 -# - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | out/stim --sample -# build_bazel: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v1 -# - uses: bazel-contrib/setup-bazel@0.8.5 -# with: -# bazelisk-cache: true -# disk-cache: ${{ github.workflow }} -# repository-cache: true -# bazelisk-version: 1.x -# - run: bazel build :all -# - run: bazel test :stim_test -# build_clang: -# runs-on: ubuntu-20.04 -# steps: -# - uses: actions/checkout@v1 -# - run: | -# cd .. -# git clone https://github.com/google/googletest.git -b release-1.12.1 -# mkdir googletest/build && cd googletest/build -# cmake .. -DBUILD_GMOCK=OFF -# make -# sudo make install -# - uses: egor-tensin/setup-clang@v1 -# with: -# version: latest -# platform: x64 -# - run: cmake . -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ -# - run: cmake --build . -# build_lib: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v1 -# - run: cmake . -# - run: make libstim -j 2 -# - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc -# - run: g++ -std=c++20 test.cc out/libstim.a -I src -# - run: ./a.out test -# build_lib_install: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v1 -# - run: mkdir install_dir -# - run: cmake . -DCMAKE_INSTALL_PREFIX=install_dir -# - run: make -j 2 -# - run: make install -# - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc -# - run: g++ -std=c++20 test.cc install_dir/lib/libstim.a -I install_dir/include -# - run: ./a.out test -# - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | install_dir/bin/stim --sample -# benchmark_windows: -# runs-on: windows-latest -# steps: -# - uses: actions/checkout@v1 -# - uses: microsoft/setup-msbuild@v1.0.2 -# - run: cmake . -# - run: MSBuild.exe stim_perf.vcxproj /p:Configuration=Release /p:OutDir=msbuild_out /p:O=2 -# - run: msbuild_out/stim_perf.exe -# benchmark: -# runs-on: ubuntu-latest -# strategy: -# matrix: -# simd_width: [64, 128, 256] -# steps: -# - uses: actions/checkout@v1 -# - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} -# - run: make stim_perf -j 2 -# - run: out/stim_perf -# test: -# runs-on: ubuntu-latest -# strategy: -# matrix: -# simd_width: [64, 128, 256] -# steps: -# - uses: actions/checkout@v1 -# - run: | -# cd .. -# git clone https://github.com/google/googletest.git -b release-1.12.1 -# mkdir googletest/build && cd googletest/build -# cmake .. -DBUILD_GMOCK=OFF -# make -# sudo make install -# - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} -# - run: make stim_test -j 2 -# - run: out/stim_test -# test_o3: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v1 -# - run: | -# cd .. -# git clone https://github.com/google/googletest.git -b release-1.12.1 -# mkdir googletest/build && cd googletest/build -# cmake .. -DBUILD_GMOCK=OFF -# make -# sudo make install -# - run: cmake . -DSIMD_WIDTH=256 -# - run: make stim_test_o3 -j 2 -# - run: out/stim_test_o3 -# test_generated_docs_are_fresh: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - uses: bazel-contrib/setup-bazel@0.8.5 -# with: -# bazelisk-cache: true -# disk-cache: ${{ github.workflow }} -# repository-cache: true -# bazelisk-version: 1.x -# - uses: actions/setup-node@v1 -# with: -# node-version: 16.x -# - run: bazel build :stim_dev_wheel -# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl -# - run: diff <(python dev/gen_stim_api_reference.py -dev) doc/python_api_reference_vDev.md -# - run: diff <(python dev/gen_stim_stub_file.py -dev) glue/python/src/stim/__init__.pyi -# - run: diff <(python dev/gen_stim_stub_file.py -dev) doc/stim.pyi -# - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'gates_markdown'])") doc/gates.md -# - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'formats_markdown'])") doc/result_formats.md -# - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'commands_markdown'])") doc/usage_command_line.md -# - run: diff <(dev/gen_known_gates_for_js.sh) glue/crumble/test/generated_gate_name_list.test.js -# - run: python doc/stim.pyi -# - run: npm install -g rollup@3.21.2 uglify-js@3.17.4 -# - run: diff <(dev/compile_crumble_into_cpp_string_file.sh) src/stim/diagram/crumble_data.cc -# - run: pip install -e glue/sample -# - run: diff <(python dev/gen_sinter_api_reference.py -dev) doc/sinter_api.md -# test_generated_file_lists_are_fresh: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - run: dev/regen_file_lists.sh /tmp -# - run: diff /tmp/perf_files file_lists/perf_files -# - run: diff /tmp/pybind_files file_lists/pybind_files -# - run: diff /tmp/source_files_no_main file_lists/source_files_no_main -# - run: diff /tmp/test_files file_lists/test_files -# test_pybind: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - uses: bazel-contrib/setup-bazel@0.8.5 -# with: -# bazelisk-cache: true -# disk-cache: ${{ github.workflow }} -# repository-cache: true -# bazelisk-version: 1.x -# - run: bazel build :stim_dev_wheel -# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl -# - run: pip install pytest -# - run: pytest src -# - run: dev/doctest_proper.py --module stim -# test_stimcirq: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - uses: bazel-contrib/setup-bazel@0.8.5 -# with: -# bazelisk-cache: true -# disk-cache: ${{ github.workflow }} -# repository-cache: true -# bazelisk-version: 1.x -# - run: bazel build :stim_dev_wheel -# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl -# - run: pip install -e glue/cirq -# - run: pip install pytest -# - run: pytest glue/cirq -# - run: dev/doctest_proper.py --module stimcirq --import cirq sympy -# test_sinter: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - uses: bazel-contrib/setup-bazel@0.8.5 -# with: -# bazelisk-cache: true -# disk-cache: ${{ github.workflow }} -# repository-cache: true -# bazelisk-version: 1.x -# - run: bazel build :stim_dev_wheel -# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl -# - run: pip install -e glue/sample -# - run: pip install pytest pymatching fusion-blossom~=0.1.4 -# - run: pytest glue/sample -# - run: dev/doctest_proper.py --module sinter -# - run: sinter help -# test_stimzx: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v3 -# - uses: bazel-contrib/setup-bazel@0.8.5 -# with: -# bazelisk-cache: true -# disk-cache: ${{ github.workflow }} -# repository-cache: true -# bazelisk-version: 1.x -# - run: bazel build :stim_dev_wheel -# - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl -# - run: pip install -e glue/zx -# - run: pip install pytest -# - run: pytest glue/zx -# - run: dev/doctest_proper.py --module stimzx -# test_stimjs: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: mymindstorm/setup-emsdk@v14 -# with: -# version: 2.0.18 -# actions-cache-folder: 'emsdk-cache' -# - uses: actions/setup-node@v1 -# with: -# node-version: 16.x -# - run: npm install -# - run: bash glue/javascript/build_wasm.sh -# - run: node puppeteer_run_tests.js -# test_crumble: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-node@v3 -# with: -# node-version: 16 -# - run: node glue/crumble/run_tests_headless.js + upload_dev_release_to_pypi: + needs: ["merge_upload_artifacts"] + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4.1.7 + with: + name: dist + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + packages_dir: dist/stim/ + password: ${{ secrets.pypi_token_stim }} + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + packages_dir: dist/stimcirq/ + password: ${{ secrets.pypi_token_stimcirq }} + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + packages_dir: dist/sinter/ + password: ${{ secrets.pypi_token_sinter }} + run_main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: cmake . + - run: make stim -j 2 + - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | out/stim --sample + build_bazel: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: bazel-contrib/setup-bazel@0.8.5 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelisk-version: 1.x + - run: bazel build :all + - run: bazel test :stim_test + build_clang: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v1 + - run: | + cd .. + git clone https://github.com/google/googletest.git -b release-1.12.1 + mkdir googletest/build && cd googletest/build + cmake .. -DBUILD_GMOCK=OFF + make + sudo make install + - uses: egor-tensin/setup-clang@v1 + with: + version: latest + platform: x64 + - run: cmake . -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ + - run: cmake --build . + build_lib: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: cmake . + - run: make libstim -j 2 + - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc + - run: g++ -std=c++20 test.cc out/libstim.a -I src + - run: ./a.out test + build_lib_install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: mkdir install_dir + - run: cmake . -DCMAKE_INSTALL_PREFIX=install_dir + - run: make -j 2 + - run: make install + - run: echo -e '#include "stim.h"\nint main(int argc,const char **argv) {return !stim::find_bool_argument("test", argc, argv);}' > test.cc + - run: g++ -std=c++20 test.cc install_dir/lib/libstim.a -I install_dir/include + - run: ./a.out test + - run: echo -e "H 0 \n CNOT 0 1 \n M 0 1" | install_dir/bin/stim --sample + benchmark_windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: microsoft/setup-msbuild@v1.0.2 + - run: cmake . + - run: MSBuild.exe stim_perf.vcxproj /p:Configuration=Release /p:OutDir=msbuild_out /p:O=2 + - run: msbuild_out/stim_perf.exe + benchmark: + runs-on: ubuntu-latest + strategy: + matrix: + simd_width: [64, 128, 256] + steps: + - uses: actions/checkout@v1 + - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} + - run: make stim_perf -j 2 + - run: out/stim_perf + test: + runs-on: ubuntu-latest + strategy: + matrix: + simd_width: [64, 128, 256] + steps: + - uses: actions/checkout@v1 + - run: | + cd .. + git clone https://github.com/google/googletest.git -b release-1.12.1 + mkdir googletest/build && cd googletest/build + cmake .. -DBUILD_GMOCK=OFF + make + sudo make install + - run: cmake . -DSIMD_WIDTH=${{ matrix.simd_width }} + - run: make stim_test -j 2 + - run: out/stim_test + test_o3: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: | + cd .. + git clone https://github.com/google/googletest.git -b release-1.12.1 + mkdir googletest/build && cd googletest/build + cmake .. -DBUILD_GMOCK=OFF + make + sudo make install + - run: cmake . -DSIMD_WIDTH=256 + - run: make stim_test_o3 -j 2 + - run: out/stim_test_o3 + test_generated_docs_are_fresh: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: bazel-contrib/setup-bazel@0.8.5 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelisk-version: 1.x + - uses: actions/setup-node@v1 + with: + node-version: 16.x + - run: bazel build :stim_dev_wheel + - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl + - run: diff <(python dev/gen_stim_api_reference.py -dev) doc/python_api_reference_vDev.md + - run: diff <(python dev/gen_stim_stub_file.py -dev) glue/python/src/stim/__init__.pyi + - run: diff <(python dev/gen_stim_stub_file.py -dev) doc/stim.pyi + - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'gates_markdown'])") doc/gates.md + - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'formats_markdown'])") doc/result_formats.md + - run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'commands_markdown'])") doc/usage_command_line.md + - run: diff <(dev/gen_known_gates_for_js.sh) glue/crumble/test/generated_gate_name_list.test.js + - run: python doc/stim.pyi + - run: npm install -g rollup@3.21.2 uglify-js@3.17.4 + - run: diff <(dev/compile_crumble_into_cpp_string_file.sh) src/stim/diagram/crumble_data.cc + - run: pip install -e glue/sample + - run: diff <(python dev/gen_sinter_api_reference.py -dev) doc/sinter_api.md + test_generated_file_lists_are_fresh: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: dev/regen_file_lists.sh /tmp + - run: diff /tmp/perf_files file_lists/perf_files + - run: diff /tmp/pybind_files file_lists/pybind_files + - run: diff /tmp/source_files_no_main file_lists/source_files_no_main + - run: diff /tmp/test_files file_lists/test_files + test_pybind: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: bazel-contrib/setup-bazel@0.8.5 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelisk-version: 1.x + - run: bazel build :stim_dev_wheel + - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl + - run: pip install pytest + - run: pytest src + - run: dev/doctest_proper.py --module stim + test_stimcirq: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: bazel-contrib/setup-bazel@0.8.5 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelisk-version: 1.x + - run: bazel build :stim_dev_wheel + - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl + - run: pip install -e glue/cirq + - run: pip install pytest + - run: pytest glue/cirq + - run: dev/doctest_proper.py --module stimcirq --import cirq sympy + test_sinter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: bazel-contrib/setup-bazel@0.8.5 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelisk-version: 1.x + - run: bazel build :stim_dev_wheel + - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl + - run: pip install -e glue/sample + - run: pip install pytest pymatching fusion-blossom~=0.1.4 + - run: pytest glue/sample + - run: dev/doctest_proper.py --module sinter + - run: sinter help + test_stimzx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: bazel-contrib/setup-bazel@0.8.5 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelisk-version: 1.x + - run: bazel build :stim_dev_wheel + - run: pip install bazel-bin/stim-0.0.dev0-py3-none-any.whl + - run: pip install -e glue/zx + - run: pip install pytest + - run: pytest glue/zx + - run: dev/doctest_proper.py --module stimzx + test_stimjs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: mymindstorm/setup-emsdk@v14 + with: + version: 2.0.18 + actions-cache-folder: 'emsdk-cache' + - uses: actions/setup-node@v1 + with: + node-version: 16.x + - run: npm install + - run: bash glue/javascript/build_wasm.sh + - run: node puppeteer_run_tests.js + test_crumble: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: node glue/crumble/run_tests_headless.js