Skip to content

Commit

Permalink
CI & CD: macos and windows install from src
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Aug 12, 2022
1 parent 995e45b commit 04e1e50
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/test-src-build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build from source(macOS)

on:
workflow_dispatch:
pull_request:
branches: [master]
types: [opened, reopened, edited]
paths:
- 'libheif/macos/**'
- 'libheif/build.py'
- 'libheif/heif.h'
- 'setup.*'
- 'pyproject.toml'
push:
branches: [master]
paths:
- 'libheif/macos/**'
- 'libheif/build.py'
- 'libheif/heif.h'
- 'setup.*'
- 'pyproject.toml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
macos_11:
name: macOS:11-x86_64
runs-on: macos-11

steps:
- uses: actions/checkout@v3

- name: Install brew
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install --formula ./libheif/macos/libheif.rb
- name: Installing Pillow-Heif
run: python3 -m pip -v install ".[dev]"

- name: Perform tests
run: python3 -m pytest -s
67 changes: 67 additions & 0 deletions .github/workflows/test-src-build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build from source(Windows)

on:
workflow_dispatch:
pull_request:
branches: [master]
types: [opened, reopened, edited]
paths:
- 'libheif/windows/**'
- 'libheif/build.py'
- 'libheif/heif.h'
- 'setup.*'
- 'pyproject.toml'
push:
branches: [master]
paths:
- 'libheif/windows/**'
- 'libheif/build.py'
- 'libheif/heif.h'
- 'setup.*'
- 'pyproject.toml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
windows_2019:
name: Windows:2019-x86_64
runs-on: windows-2019
env:
VCPKG_PREFIX: "C:/temp/msys64/mingw64"

steps:
- uses: actions/checkout@v3

- uses: msys2/setup-msys2@v2
with:
location: C:/temp
update: true
install: >-
patch
mingw-w64-x86_64-binutils
- name: Build libheif and dependencies
shell: msys2 {0}
run: |
cd libheif/windows/mingw-w64-libheif
makepkg-mingw --syncdeps --noconfirm -f
pacman -U mingw-w64-x86_64-libheif-1.12.0-9-any.pkg.tar.zst --noconfirm
- name: Installing Pillow-Heif
run: python -m pip -v install ".[dev]"

- name: Copy DLLs from MSYS2
run: |
$site_packages=(python -c 'import sysconfig; print(sysconfig.get_paths()[\"platlib\"])')
cp ${{ env.VCPKG_PREFIX }}/bin/libheif.dll $site_packages/
cp ${{ env.VCPKG_PREFIX }}/bin/libde265-0.dll $site_packages/
cp ${{ env.VCPKG_PREFIX }}/bin/libx265.dll $site_packages/
cp ${{ env.VCPKG_PREFIX }}/bin/libaom.dll $site_packages/
cp ${{ env.VCPKG_PREFIX }}/bin/libwinpthread-1.dll $site_packages/
cp ${{ env.VCPKG_PREFIX }}/bin/libgcc_s_seh-1.dll $site_packages/
cp ${{ env.VCPKG_PREFIX }}/bin/libstdc++-6.dll $site_packages/
- name: Perform tests
run: python -m pytest -s

0 comments on commit 04e1e50

Please sign in to comment.