Skip to content
Merged
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
76 changes: 76 additions & 0 deletions .github/workflows/cpu-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Pull Request for Multiple Platform with CPU

on:
pull_request:
branches: [main]
paths-ignore:
- "doc/**"
- "**.md"

jobs:
ci:
name: CI
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
os: ["ubuntu-latest", "macos-13", "macos-latest"] # "ubuntu-24.04-arm" unsupported

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

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
lfs: true

- name: Install Prerequisites for Linux
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' }}
run:
sudo apt update && sudo apt install -y libturbojpeg exiftool ffmpeg libheif-dev poppler-utils

- name: Install Prerequisites for MacOS
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }}
run:
brew install libjpeg exiftool ffmpeg libheif poppler

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Install Dependencies
run: |
python -m pip install -U pip wheel "numpy>=2" "cython>=3.0.12" "setuptools>=69"
python setup.py build_ext --inplace
python -m pip install .

- name: Lint with Pylint
run: |
python -m pip install pylint
python -m pylint pyface --rcfile=.github/workflows/.pylintrc

- name: Run Tests with Pytest
run: |
mkdir -p tests/coverage
python -m pip install pytest pytest-cov typeguard
python -m pytest tests --junitxml=tests/coverage/cov-junitxml.xml --cov=pyface

- name: Surface failing tests
uses: pmeier/pytest-results-action@main
with:
path: tests/coverage/cov-junitxml.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results

- name: Clean artifacts
run:
rm -rf dist wheelhouse build *.egg-info

- name: Clean workspace when fail
if: failure()
run:
rm -rf ${{ github.workspace }}
65 changes: 65 additions & 0 deletions .github/workflows/cuda-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Pull Request for Ubuntu with GPU

on:
pull_request:
branches: [main]
paths-ignore:
- "doc/**"
- "**.md"

jobs:
ci:
name: CI
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]

runs-on: ["self-hosted", "unicorn"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Install dependencies
run: |
python -m pip install -U pip wheel "numpy>=2" "cython>=3.0.12" "setuptools>=69"
python setup.py build_ext --inplace
python -m pip install .

- name: Lint with pylint
run: |
python -m pip install pylint
python -m pylint pyface --rcfile=.github/workflows/.pylintrc

- name: Run tests with pytest
run: |
mkdir -p tests/coverage
python -m pip install pytest pytest-cov typeguard
python -m pytest tests --junitxml=tests/coverage/cov-junitxml.xml --cov=pyface

- name: Surface failing tests
uses: pmeier/pytest-results-action@main
with:
path: tests/coverage/cov-junitxml.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results

- name: Clean artifacts
run:
rm -rf dist wheelhouse build *.egg-info

- name: Clean workspace when fail
if: failure()
run:
rm -rf ${{ github.workspace }}
98 changes: 0 additions & 98 deletions .github/workflows/pull_request.yml

This file was deleted.

91 changes: 72 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ on:
inputs:
branch:
description: "Create release with branch or sha1"
default: "main"
required: true
version_tag:
description: "Release version (a.b.c)"
required: true

jobs:
Release:
runs-on: [self-hosted, unicorn]
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.12"
os: ["ubuntu-latest", "macos-13", "macos-latest"] # "ubuntu-24.04-arm" unsupported

steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -27,11 +27,51 @@ jobs:
token: ${{ secrets.CI_PAT_DS }}
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python (host)
uses: actions/setup-python@v5
with:
check-latest: true
python-version: ${{ matrix.python-version }}
python-version: "3.12"

- name: Bump package version
run: |
sed -i.bak "s/__version__ = .*/__version__ = '${{ github.event.inputs.version_tag }}'/" pyface/__init__.py || \
sed -i "s/__version__ = .*/__version__ = '${{ github.event.inputs.version_tag }}'/" pyface/__init__.py

- name: Install tools
run: |
python -m pip install -U pip setuptools wheel cibuildwheel

- name: Build wheels with cibuildwheel
run: |
python -m cibuildwheel --output-dir wheelhouse

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}
path: wheelhouse/*.whl
if-no-files-found: error
retention-days: 3
overwrite: true

- name: Clean workspace when fail
if: failure()
run: |
rm -rf ${{ github.workspace }}

release:
name: Create GitHub Release
needs: build_wheels
runs-on: unicorn

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.CI_PAT_DS }}
fetch-depth: 0

- name: Update Python version
run: |
Expand All @@ -44,28 +84,41 @@ jobs:
message: "[C] Update package version"
github_token: ${{ secrets.CI_PAT_DS }}

- name: Build wheel
run: |
python -m pip install setuptools wheel twine
python setup.py bdist_wheel
python -m twine upload dist/*.whl
- name: Download all wheels
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: wheelhouse

- name: List downloaded artifacts
run: ls -al wheelhouse/**

- name: Create Release
id: create_release
- name: Create GitHub Release (attach wheels)
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.version_tag }}
name: Release ${{ github.event.inputs.version_tag }}
body: |
# Release Note
# Release Notes
allowUpdates: true
artifactErrorsFailBuild: true
draft: true
prerelease: false
generateReleaseNotes: true
discussionCategory: General
artifacts: "${{ github.workspace }}/dist/pyface_docsaid-*-none-any.whl"
artifacts: |
wheelhouse/**/*.whl

- name: Twine check & upload to PyPI
run: |
python -m twine check wheelhouse/**/*
python -m twine upload --skip-existing wheelhouse/**/*.whl

- name: Clean artifacts
if: always()
run: rm -rf dist wheelhouse build *.egg-info

- name: Clean wheel
- name: Clean workspace when fail
if: failure()
run: |
rm -fr ${{ github.workspace }}/dist/*
rm -rf ${{ github.workspace }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,7 @@ cython_debug/

# PyPI configuration file
.pypirc
.python-version
.python-version

pyface/components/face_depth/Sim3DR/rasterize.c
pyface/components/face_depth/Sim3DR/rasterize.cpp
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.md LICENSE
recursive-include pyface/components/face_depth/Sim3DR *.pyx *.pxd *.h *.cpp
Loading
Loading