diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c488a09..0d7ab23 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,10 +9,15 @@ on: jobs: linux: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + architecture: [x86-64, aarch64] + exclude: + - os: windows-latest + architecture: aarch64 steps: - uses: actions/checkout@v4 - name: Set up Python @@ -28,6 +33,13 @@ jobs: - name: Set up rustfmt run: rustup component add rustfmt + - name: Set Rust target for aarch64 + if: matrix.architecture == 'aarch64' + id: target + run: | + TARGET=${{ matrix.os == 'macos-latest' && 'aarch64-apple-darwin' || 'aarch64-unknown-linux-gnu'}} + echo "target=$TARGET" >> $GITHUB_OUTPUT + # Maturin requires a venv to be activated, that's why we have to create one here - name: Create virtualenv run: | @@ -43,32 +55,4 @@ jobs: - name: Test run: | source .venv/bin/activate - make test-ci - - macos: - runs-on: macos-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v4 - - name: build (fast) - uses: messense/maturin-action@v1 - with: - command: build - target: universal2-apple-darwin - args: "-o dist --interpreter python${{ matrix.python-version }}" - - windows: - runs-on: windows-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v4 - - name: build (fast) - uses: messense/maturin-action@v1 - with: - command: build - target: x64 - args: "-o dist --interpreter python${{ matrix.python-version }}" + TARGET="${{ steps.target.outputs.target }}" make test-ci diff --git a/Makefile b/Makefile index cdde098..e258562 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,11 @@ dev-setup: install-test-requirements install-doc-requirements pre-commit install dev-install: - maturin develop -E pandas,polars + if [ -z "${TARGET}" ]; then \ + maturin develop -E pandas,polars; \ + else \ + maturin develop --target "${TARGET}" -E pandas,polars; \ + fi prod-install: ./prod_install.sh