Skip to content

Commit

Permalink
test arm64 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sygslhy committed Nov 26, 2024
1 parent 27917fc commit e87c6af
Showing 1 changed file with 88 additions and 21 deletions.
109 changes: 88 additions & 21 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Test the PYPI package in all the platforms


# on: [push, pull_request]
on: [push, pull_request]

on:
schedule:
- cron: '30 10 * * 1'
# on:
# schedule:
# - cron: '30 10 * * 1'

jobs:
checkout-code:
Expand All @@ -22,14 +22,46 @@ jobs:
name: test
path: ./test/

test-download-package:
# test-x86_64-package:
# needs: checkout-code
# name: Test package ${{ matrix.os }} ${{ matrix.python-version }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [windows-2019, windows-2022, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15]
# python-version: ["3.10", "3.11","3.12", "3.13"]

# steps:
# - name: Download git repo code
# uses: actions/download-artifact@v4
# with:
# pattern: test
# path: image_io/

# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install cxx-image-io from test pypi and run NRT test
# run: |
# python -c "import sys; print(sys.version)"
# python -m pip install --upgrade pip
# python -m pip install numpy pytest
# pip install cxx-image-io
# cd image_io/
# mkdir -p test/_outputs
# pytest -sv

test-arm64-package:
needs: checkout-code
name: Test package
runs-on: ${{ matrix.os }}
name: Test package on ${{ matrix.distro }} ${{ matrix.arch }}
# The host should always be linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15]
python-version: ["3.10", "3.11","3.12", "3.13"]
distro: [ubuntu_latest, bookworm, fedora_latest, alpine_latest, archarm_latest]
arch: [aarch64]

steps:
- name: Download git repo code
Expand All @@ -38,16 +70,51 @@ jobs:
pattern: test
path: image_io/

- uses: actions/setup-python@v5
# Run steps on a matrix of 4 arch/distro combinations
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
python-version: ${{ matrix.python-version }}

- name: Install cxx-image-io from test pypi and run NRT test
run: |
python -c "import sys; print(sys.version)"
python -m pip install --upgrade pip
python -m pip install numpy pytest
pip install cxx-image-io
cd image_io/
mkdir -p test/_outputs
pytest -sv
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}

# Not required, but speeds up builds
githubToken: ${{ github.token }}
# Mount the image_io/test directory as /test in the container
dockerRunArgs: |
--volume "${PWD}/image_io/test:/test"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: pytest-${{ matrix.distro }}_${{ matrix.arch }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
case "${{ matrix.distro }}" in
ubuntu*|bookworm)
apt-get update -q -y
apt-get install -q -y git ninja-build nasm python3 python3-pip python3-pytest cmake
;;
fedora*)
dnf -y update
dnf -y install git which ninja-build nasm python3 python3-pip python3-pytest cmake
;;
alpine*)
apk update
apk add git nasm samurai python3 py3-pip py3-pytest cmake
;;
archarm*)
pacman -Sy --needed --noconfirm git cmake ninja
;;
esac
# Produce a binary artifact and place it in the mounted volume
run: |
cd /test
pip install cxx-image-io --break-system-packages
mkdir -p /test/_outputs
pytest -sv

0 comments on commit e87c6af

Please sign in to comment.