Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build x86_64 and aarch64 wheels separately #79

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Build

on:
push:
branches:
- main
push:
branches:
- main

jobs:
build:
strategy:
matrix:
platform: [ windows-latest, macos-latest, ubuntu-latest ]
build:
strategy:
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]

runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build (macOS)
if: matrix.platform == 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
target: universal2-apple-darwin
args: --release -o dist
- name: Build (macOS)
if: matrix.platform == 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
target: universal2-apple-darwin
args: --release -o dist

- name: Build
if: matrix.platform != 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist
- name: Build
if: matrix.platform != 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{matrix.platform}} wheels
path: dist
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{matrix.platform}} wheels
path: dist
196 changes: 153 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,41 @@ on:
- "nightly"

jobs:
build:
name: Build
windows:
name: Build and test on Windows
strategy:
matrix:
platform:
- windows-latest
- ubuntu-latest
- macos-latest
python:
- "3.8"
- "3.9"
- "3.10"

runs-on: ${{ matrix.platform }}

permissions:
actions: write

runs-on: windows-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
ref: main
submodules: true

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

architecture: ${{ matrix.target }}
- name: Checkout core-libs nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
working-directory: ${{github.workspace}}/acquire/acquire-core-libs
- name: Checkout runtime nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
git submodule update
working-directory: ${{github.workspace}}/acquire-video-runtime

working-directory: ${{github.workspace}}/acquire/acquire-video-runtime
- name: Set config to pull nightly drivers
if: ${{github.ref_name == 'nightly'}}
run: |
Expand All @@ -61,54 +54,171 @@ jobs:
}
EOF
shell: bash

- name: Build (macOS)
if: matrix.platform == 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
target: universal2-apple-darwin
args: --release -o dist

- name: Build (Windows, Linux)
if: matrix.platform != 'macos-latest'
uses: messense/maturin-action@v1
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
args: --release -o dist

target: x64
args: --release --out dist
sccache: 'true'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov tifffile zarr dask ome-zarr

- name: Install Acquire (Windows)
if: matrix.platform == 'windows-latest'
- name: Install Acquire
run: |
$whl = ls | Select -First 1
python -m pip install $whl
shell: pwsh
working-directory: "${{ github.workspace }}/dist"
- name: Test artifact
run: |
python -m pytest -k test_basic --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

- name: Install Acquire (Linux, macOS)
if: matrix.platform != 'windows-latest'
macos:
name: Build and test on macOS
runs-on: macos-latest
strategy:
matrix:
target: [ x86_64, aarch64 ]
python:
- "3.8"
- "3.9"
- "3.10"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Checkout core-libs nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
working-directory: ${{github.workspace}}/acquire/acquire-core-libs
- name: Checkout runtime nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
working-directory: ${{github.workspace}}/acquire/acquire-video-runtime
- name: Set config to pull nightly drivers
if: ${{github.ref_name == 'nightly'}}
run: |
cat >drivers.json <<EOF
{
"acquire-driver-common": "nightly",
"acquire-driver-zarr": "nightly",
"acquire-driver-egrabber": "nightly",
"acquire-driver-hdcam": "nightly"
}
EOF
shell: bash
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: 'true'
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov tifffile zarr dask ome-zarr
- name: Install Acquire
if: ${{ matrix.target == 'x86_64' }}
run: python -m pip install *.whl
working-directory: "${{ github.workspace }}/dist"

- name: Test artifact
if: ${{ matrix.target == 'x86_64' }}
run: |
python -m pytest -k test_basic --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

linux:
name: Build and test on Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Checkout core-libs nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
working-directory: ${{github.workspace}}/acquire/acquire-core-libs
- name: Checkout runtime nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
working-directory: ${{github.workspace}}/acquire-video-runtime
- name: Set config to pull nightly drivers
if: ${{github.ref_name == 'nightly'}}
run: |
cat >drivers.json <<EOF
{
"acquire-driver-common": "nightly",
"acquire-driver-zarr": "nightly",
"acquire-driver-egrabber": "nightly",
"acquire-driver-hdcam": "nightly"
}
EOF
shell: bash
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov tifffile zarr dask ome-zarr
- name: Install Acquire
run: python -m pip install *.whl
working-directory: "${{ github.workspace }}/dist"
- name: Test artifact
run: |
python -m pytest -k test_basic --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{matrix.platform}} wheels
name: wheels
path: dist

release:
needs: build
name: "Release"
runs-on: "ubuntu-latest"
needs:
- windows
- macos
- linux
name: Release
runs-on: ubuntu-latest

environment:
name: pypi
Expand Down
Loading