mirror of
https://github.com/zhigang1992/PerspectiveTransform.git
synced 2026-01-12 09:14:11 +08:00
add macOS workflow (#113)
* add macos workflow * update opencv install script * cache OpenCV brew installation * update badge
This commit is contained in:
33
.github/workflows/mac-os.yml
vendored
Normal file
33
.github/workflows/mac-os.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: macOS
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
macOS:
|
||||
name: Test on macOS
|
||||
runs-on: macOS-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.2
|
||||
- uses: actions/cache@v2.1.1
|
||||
id: opencv-cache
|
||||
with:
|
||||
key: opencv-${{ hashFiles('**/install-opencv.sh') }}
|
||||
path: |
|
||||
/usr/local/Cellar/openblas
|
||||
/usr/local/Cellar/tbb
|
||||
/usr/local/Cellar/gcc
|
||||
/usr/local/Cellar/opencv
|
||||
- name: Install OpenCV
|
||||
run: Example/OpenCV-OSX-Tests/install-opencv.sh
|
||||
- uses: actions/cache@v2.1.1
|
||||
id: pods-cache
|
||||
with:
|
||||
path: Example/Pods
|
||||
key: macos-pods-${{ hashFiles('**/Podfile.lock') }}
|
||||
- name: Install Cocoapods dependencies
|
||||
if: steps.pods-cache.outputs.cache-hit != 'true'
|
||||
run: pod install --project-directory=Example
|
||||
- name: All Tests
|
||||
uses: sersoft-gmbh/xcodebuild-action@v1.1
|
||||
with:
|
||||
workspace: Example/PerspectiveTransform.xcworkspace
|
||||
scheme: OpenCV Tests
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
# install-opencv.sh
|
||||
|
||||
libraries="tbb openblas gcc ffmpeg libpng libtiff ilmbase openexr jpeg opencore-amr snappy lame openjpeg opus speex theora libogg libvorbis x264 x265 libsoxr libbluray gnutls rtmpdump openssl fontconfig freetype p11-kit libunistring libtasn1 nettle gmp libffi"
|
||||
libraries="openblas tbb gcc"
|
||||
|
||||
for package in opencv $libraries; do brew link $package || brew install --ignore-dependencies --force-bottle $package; done
|
||||
# due to Warning: Refusing to link macOS-provided software: openblas
|
||||
# link /usr/local/opt/openblas is not getting restored
|
||||
ln -s /usr/local/Cellar/openblas/`ls /usr/local/Cellar/openblas` /usr/local/opt/openblas || true
|
||||
for package in $libraries opencv
|
||||
do
|
||||
brew list $package || brew install --ignore-dependencies --force-bottle $package
|
||||
done
|
||||
|
||||
# To remove all dependencies:
|
||||
# for package in opencv $(brew deps opencv); do brew rm --ignore-dependencies --force $package; done
|
||||
brew link opencv
|
||||
|
||||
9
Example/OpenCV-OSX-Tests/uninstall-opencv.sh
Executable file
9
Example/OpenCV-OSX-Tests/uninstall-opencv.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# uninstall-opencv.sh
|
||||
|
||||
# To remove all dependencies:
|
||||
for package in opencv $(brew deps opencv)
|
||||
do
|
||||
brew rm --ignore-dependencies --force $package
|
||||
done
|
||||
@@ -77,6 +77,7 @@
|
||||
11CFEB20812B9CCCF8BF46FE /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
228B48512798F0994ED8E8A0 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
4B1B1C0C1C7A76C8003F8165 /* PerformanceTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PerformanceTest.swift; sourceTree = "<group>"; };
|
||||
4B29775C25089A0000830FB8 /* workflows */ = {isa = PBXFileReference; lastKnownFileType = folder; name = workflows; path = ../.github/workflows; sourceTree = "<group>"; };
|
||||
4B2D2E861C7C2AD10045FD11 /* SnapshotSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SnapshotSpec.swift; sourceTree = "<group>"; };
|
||||
4B2D2E881C7C2E620045FD11 /* container.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = container.jpg; sourceTree = "<group>"; };
|
||||
4B2D2E891C7C2E620045FD11 /* with-overlay.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "with-overlay.svg"; sourceTree = "<group>"; };
|
||||
@@ -300,6 +301,7 @@
|
||||
11CFEB20812B9CCCF8BF46FE /* LICENSE */,
|
||||
4BA7B1481C7C7A0600933779 /* .travis.yml */,
|
||||
4B42173E2047AA4100BA73C2 /* codecov.yml */,
|
||||
4B29775C25089A0000830FB8 /* workflows */,
|
||||
4B714005205E16AA004441A8 /* Gemfile */,
|
||||
4B714007205E16E8004441A8 /* Gemfile.lock */,
|
||||
);
|
||||
|
||||
1
Gemfile
1
Gemfile
@@ -5,6 +5,7 @@ gem 'xcpretty' # to simulate travis output
|
||||
|
||||
group :travis do
|
||||
gem 'xcpretty-travis-formatter'
|
||||
# gem 'travis' # to debug builds, see https://docs.travis-ci.com/user/running-build-in-debug-mode/
|
||||
end
|
||||
|
||||
group :github do
|
||||
|
||||
@@ -97,4 +97,4 @@ DEPENDENCIES
|
||||
xcpretty-travis-formatter
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.2
|
||||
2.1.4
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Perspective Transform
|
||||
|
||||
[](https://travis-ci.org/paulz/PerspectiveTransform)
|
||||
[](https://github.com/paulz/PerspectiveTransform/actions?query=workflow%3AmacOS)
|
||||
[](https://circleci.com/gh/paulz/PerspectiveTransform)
|
||||
[](https://codecov.io/gh/paulz/PerspectiveTransform)
|
||||
[](http://cocoapods.org/pods/PerspectiveTransform)
|
||||
|
||||
Reference in New Issue
Block a user