Skip to content

Commit

Permalink
ci improvements (#52)
Browse files Browse the repository at this point in the history
* add python 3.12

* test linux container

* remove dlpack-rs

* remove docke setup

* test windows

* test windows

* test macos

* try linux i686

* add nasm

* enable all again

* cleanup

* remove dlpack-rs for now

* update deps

* test ci i686

* test i686

* fix typo

* try install dps

* try again

* try test macos

* try again

* try macos

* try macos

* deps
  • Loading branch information
edgarriba authored Mar 15, 2024
1 parent 0036d7c commit b3e9c60
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 321 deletions.
40 changes: 15 additions & 25 deletions .github/workflows/python_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,23 @@ name: Python Release
on:
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# env:
# REGISTRY: ghcr.io
# IMAGE_NAME: ${{ github.repository }}

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
target: [x86_64, aarch64]

steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v4
- uses: messense/maturin-action@v1
with:
container: ghcr.io/kornia/kornia-rs/release-${{ matrix.target }}:latest
target: ${{ matrix.target }}
manylinux: auto
command: build
Expand All @@ -44,12 +34,12 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
target: [x86_64, aarch64]
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -61,9 +51,9 @@ jobs:
override: true
- uses: messense/maturin-action@v1
with:
maturin-version: latest
command: build
args: --target ${{ matrix.target }}-apple-darwin --release --out dist -i python${{ matrix.python-version }} -m py-kornia/Cargo.toml --sdist
maturin-version: latest
args: --release --target ${{ matrix.target }}-apple-darwin --out dist -i python${{ matrix.python-version }} -m py-kornia/Cargo.toml --sdist
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
Expand All @@ -74,12 +64,12 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
target: [x64, x86]
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
Expand All @@ -90,8 +80,8 @@ jobs:
override: true
- uses: messense/maturin-action@v1
with:
maturin-version: latest
command: build
maturin-version: latest
args: --release --out dist -i python${{ matrix.python-version }} -m py-kornia/Cargo.toml --sdist
- name: Upload wheels
uses: actions/upload-artifact@v2
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,43 @@ concurrency:
cancel-in-progress: true

jobs:
test-python:
test-python-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: sudo apt-get install -y cmake nasm
- name: Build and test
run: make test-python
test-python-macos:
runs-on: macos-latest
steps:
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
architecture: x64
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-apple-darwin
override: true
- uses: messense/maturin-action@v1
with:
command: build
maturin-version: latest
args: --target x86_64-apple-darwin --out dist -m py-kornia/Cargo.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip |
python -m pip install dist/*.whl |
python -m pip install pytest torch numpy
- name: Build and test
run: pytest py-kornia/tests
5 changes: 1 addition & 4 deletions .github/workflows/rust_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ on:
branches:
- main

env:
# https://github.com/huggingface/candle/issues/1516
CUDA_COMPUTE_CAP: 75

jobs:
build_and_test:
name: Test Suite - ${{ matrix.target }}
strategy:
matrix:
target:
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu

Expand Down
3 changes: 3 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ dockerfile = "devel-x86_64.Dockerfile"

[target.aarch64-unknown-linux-gnu]
dockerfile = "devel-aarch64.Dockerfile"

[target.i686-unknown-linux-gnu]
dockerfile = "devel-i686.Dockerfile"
5 changes: 2 additions & 3 deletions devel-aarch64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main

RUN dpkg --add-architecture arm64 && \
apt-get update && \
RUN apt-get update && \
apt-get install --assume-yes \
cmake \
nasm:arm64 \
nasm \
&& \
apt-get clean
9 changes: 9 additions & 0 deletions devel-i686.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ghcr.io/cross-rs/i686-unknown-linux-gnu:main

RUN apt-get update && \
apt-get install --assume-yes \
cmake \
gcc \
nasm \
&& \
apt-get clean
Loading

0 comments on commit b3e9c60

Please sign in to comment.