diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c277a7b..b949658 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfb554b..4b7de4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/cancel-workflow-action@0.11.0 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: | @@ -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/cancel-workflow-action@0.11.0 + 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 <drivers.json <