Skip to content

Commit

Permalink
Fixing github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaDdS committed May 6, 2024
1 parent 194dfb0 commit 9cbbe3c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
55 changes: 46 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,39 @@ jobs:
build_type: ['Debug', 'Release']
config:
- { name: '🍏 macOS Clang', os: macos-latest }
- { name: '🐧 Linux GCC', os: ubuntu-latest }
- { name: '🐧 Linux GCC', os: ubuntu-20.04 }
- { name: '🪟 Windows MSVC', os: windows-latest }

name: 🛠 Build / ${{ matrix.config.name }} (${{ matrix.build_type }})
runs-on: ${{ matrix.config.os }}

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
run: brew install ccache ninja
run: |
brew install ccache ninja
ruby - e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2 > /dev/null
brew reinstall --build-from-source cmake
ln -s /usr/local/Cellar/cmake/3.27.1 /usr/local/Cellar/cmake/3.26.4
brew install create-dmg
ruby - e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2 > /dev/null
brew install --build-from-source cmake
git clone https://github.com/opencv/opencv.git --branch 4.0.0 --depth 1
cmake -S opencv -B opencv/build -D ENABLE_PRECOMPILED_HEADERS=OFF -D WITH_MSMF=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D BUILD_DOCS=OFF -D WITH_JPEG=OFF -D WITH_FFMPEG=OFF -D CMAKE_BUILD_TYPE=RELEASE
cd ./opencv/build
make
sudo make install
- name: Install Dependencies (Linux)
if: matrix.config.os == 'ubuntu-latest'
if: matrix.config.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y ccache ninja-build
sudo apt-get install python2.7
- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
Expand All @@ -63,11 +74,37 @@ jobs:
max-size: '10G'
key: ${{ matrix.config.os }}-${{ matrix.build_type }}

- name: Install OpenCV
- name: Setup OpenCV
if: matrix.config.os == 'ubuntu-20.04'
uses: Dovyski/[email protected]
with:
opencv-version: '4.2.0'
install-deps: false

- name: Cache opencv
if: matrix.config.os == 'windows-latest'
uses: actions/cache@v4
env:
cache-name: cache-opencv
with:
path: |
C:/opencv4.0.0
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: build opencv
if: matrix.config.os == 'windows-latest'
run: |
$c="C:\opencv4.0.0"
if(-not (Test-Path $c))
{
git clone https://github.com/opencv/opencv.git --branch 4.0.0 --depth 1
cmake -G "MinGW Makefiles" -S opencv -B opencv/build -D CMAKE_INSTALL_PREFIX=C:/opencv4.0.0 -D ENABLE_PRECOMPILED_HEADERS=OFF -D WITH_MSMF=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D BUILD_WITH_DEBUG_INFO=OFF -D BUILD_DOCS=OFF -D CMAKE_BUILD_TYPE=RELEASE
cd ./opencv/build
mingw32-make
mingw32-make install
}
- name: Configure
run: >
Expand All @@ -92,12 +129,12 @@ jobs:
with:
name: ${{ github.event.repository.name }}-Debug
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*
${{ github.workspace }}/Demo/bin/*
- name: Upload artifact (Release)
if: matrix.build_type == 'Release'
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-Release
path: |
${{ github.workspace }}/install-${{ matrix.build_type }}/*
${{ github.workspace }}/Demo/bin/*
2 changes: 1 addition & 1 deletion src/OpenCVGodot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Ref<Mat> OpenCVGodot::bitwise_not( Ref<Mat> mat, Ref<Mat> mask )
mask = Ref<Mat>( memnew( Mat ) );
}

try
try
{
cv::bitwise_not( mat->get_mat(), outMat, mask->get_mat() );
}
Expand Down

0 comments on commit 9cbbe3c

Please sign in to comment.