diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 759934f2..e884b48e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,3 +46,46 @@ jobs: - name: Tests run: pytest --cov=h3 --full-trace + + test-arm64: + name: "Test ${{ matrix.pyver }} aarch64" + strategy: + matrix: + pyver: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39] + fail-fast: false + runs-on: ubuntu-latest + env: + py: /opt/python/${{ matrix.pyver }}/bin/python + img: quay.io/pypa/manylinux2014_aarch64 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout submodules + run: | + git submodule init + git submodule update + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + - name: Install tools + run: | + docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \ + ${{ env.img }} ${{ env.py }} -m pip install -U pip build + - name: Install dependencies + run: | + docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \ + ${{ env.img }} \ + bash -exc '${{ env.py }} -m pip install virtualenv && ${{ env.py }} -m venv .env && \ + source .env/bin/activate && \ + python -m pip install --upgrade pip && \ + deactivate' + - name: Test with pytest + run: | + docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \ + ${{ env.img }} \ + bash -exc '\ + source .env/bin/activate && \ + pip install --upgrade pip setuptools wheel && \ + pip install .[all] && \ + pytest --cov=h3 --full-trace && \ + deactivate' diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d3d7a5f4..cc62125e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -91,3 +91,55 @@ jobs: TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | twine upload wheelhouse/* + + arm64_make_wheels: + name: build aarch64 wheel + runs-on: [ubuntu-latest] + strategy: + matrix: + python_tag: [ "cp36-*", "cp37-*", "cp38-*", "cp39-*"] + + steps: + + ## Setup Env + + - uses: actions/checkout@v2.3.3 + with: + submodules: recursive + + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - uses: docker/setup-qemu-action@v1 + name: Set up QEMU + + - name: Install cibuildwheel + run: pip install --upgrade cibuildwheel + + - name: Build Linux + env: + CIBW_ARCHS_LINUX: aarch64 + CIBW_BUILD: ${{matrix.python_tag}} + run: | + python -m cibuildwheel --output-dir wheelhouse + ## Upload + + - name: Check with Twine + run: | + pip install --upgrade twine + twine check wheelhouse/* + - name: Upload artifacts to GitHub + if: github.event_name == 'release' + uses: actions/upload-artifact@v2 + with: + name: wheels + path: ./wheelhouse + + - name: Release to PyPI + if: github.event_name == 'release' && github.event.action == 'published' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.pypi_password }} + run: | + twine upload wheelhouse/*