diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c54e5f8..72dc0ef2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: ) echo "include=$MATRIX" | tee -a $GITHUB_OUTPUT env: - CIBW_ARCHS_LINUX: x86_64 + CIBW_ARCHS_LINUX: x86_64 aarch64 CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_ARCHS_WINDOWS: AMD64 @@ -53,6 +53,10 @@ jobs: include: ${{ fromJson(needs.generate_wheels_matrix.outputs.include) }} steps: + - uses: docker/setup-qemu-action@v2 + if: runner.os == 'Linux' + with: + platforms: arm64 - uses: actions/checkout@v4 - name: Checkout mypy shell: bash diff --git a/cibuildwheel.toml b/cibuildwheel.toml index 0b01bfdd..978688e0 100644 --- a/cibuildwheel.toml +++ b/cibuildwheel.toml @@ -89,3 +89,17 @@ before-test = [ "pip install -r {project}/mypy/test-requirements.txt", ] environment = { MYPYC_OPT_LEVEL="3", MYPYC_DEBUG_LEVEL="0", CC="clang" } + +[[tool.cibuildwheel.overrides]] +select = "*linux_aarch64" +# Only run testcheck, since the other tests are slow and can be flaky (because of TimeoutError). +test-command = """ \ + ( \ + DIR=$(python -c 'import mypy, os; dn = os.path.dirname; print(dn(dn(mypy.__path__[0])))') \ + && cp '{project}/mypy/pyproject.toml' '{project}/mypy/conftest.py' $DIR \ +\ + && MYPY_TEST_DIR=$(python -c 'import mypy.test; print(mypy.test.__path__[0])') \ +\ + && MYPY_TEST_PREFIX='{project}/mypy' pytest $MYPY_TEST_DIR/testcheck.py \ + ) +"""