diff --git a/.github/workflows/maturin.yml b/.github/workflows/maturin.yml index 25ad9b6..58154ea 100644 --- a/.github/workflows/maturin.yml +++ b/.github/workflows/maturin.yml @@ -1,7 +1,7 @@ # This file is autogenerated by maturin v1.7.3 # To update, run # -# maturin generate-ci github +# maturin generate-ci github --pytest # name: CI @@ -45,7 +45,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' manylinux: auto - name: Upload wheels @@ -53,6 +53,31 @@ jobs: with: name: wheels-linux-${{ matrix.platform.target }} path: dist + - name: pytest + if: ${{ startsWith(matrix.platform.target, 'x86_64') }} + shell: bash + run: | + set -e + python3 -m venv .venv + source .venv/bin/activate + pip install laddu --find-links dist --force-reinstall + pip install pytest + pytest + - name: pytest + if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} + uses: uraimo/run-on-arch-action@v2 + with: + arch: ${{ matrix.platform.target }} + distro: ubuntu22.04 + githubToken: ${{ github.token }} + install: | + apt-get update + apt-get install -y --no-install-recommends python3 python3-pip + pip3 install -U pip pytest + run: | + set -e + pip3 install laddu --find-links dist --force-reinstall + pytest musllinux: runs-on: ${{ matrix.platform.runner }} @@ -76,7 +101,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' manylinux: musllinux_1_2 - name: Upload wheels @@ -84,6 +109,36 @@ jobs: with: name: wheels-musllinux-${{ matrix.platform.target }} path: dist + - name: pytest + if: ${{ startsWith(matrix.platform.target, 'x86_64') }} + uses: addnab/docker-run-action@v3 + with: + image: alpine:latest + options: -v ${{ github.workspace }}:/io -w /io + run: | + set -e + apk add py3-pip py3-virtualenv + python3 -m virtualenv .venv + source .venv/bin/activate + pip install laddu --no-index --find-links dist --force-reinstall + pip install pytest + pytest + - name: pytest + if: ${{ !startsWith(matrix.platform.target, 'x86') }} + uses: uraimo/run-on-arch-action@v2 + with: + arch: ${{ matrix.platform.target }} + distro: alpine_latest + githubToken: ${{ github.token }} + install: | + apk add py3-virtualenv + run: | + set -e + python3 -m virtualenv .venv + source .venv/bin/activate + pip install pytest + pip install laddu --find-links dist --force-reinstall + pytest windows: runs-on: ${{ matrix.platform.runner }} @@ -104,13 +159,23 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 with: name: wheels-windows-${{ matrix.platform.target }} path: dist + - name: pytest + if: ${{ !startsWith(matrix.platform.target, 'aarch64') }} + shell: bash + run: | + set -e + python3 -m venv .venv + source .venv/Scripts/activate + pip install laddu --find-links dist --force-reinstall + pip install pytest + pytest macos: runs-on: ${{ matrix.platform.runner }} @@ -130,13 +195,21 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter + args: --release --out dist sccache: 'true' - name: Upload wheels uses: actions/upload-artifact@v4 with: name: wheels-macos-${{ matrix.platform.target }} path: dist + - name: pytest + run: | + set -e + python3 -m venv .venv + source .venv/bin/activate + pip install laddu --find-links dist --force-reinstall + pip install pytest + pytest sdist: runs-on: ubuntu-latest