Skip to content

Commit

Permalink
Merge pull request #331 from lovyan03/develop
Browse files Browse the repository at this point in the history
v0.5.0
  • Loading branch information
lovyan03 authored Dec 24, 2022
2 parents 3af4725 + 9c3fa21 commit 7be9f76
Show file tree
Hide file tree
Showing 128 changed files with 26,939 additions and 15,136 deletions.
31 changes: 15 additions & 16 deletions .github/scripts/installOpenCV.bat
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
::@echo off
setlocal enabledelayedexpansion
::DO_NOT_CHANGE::
::============================================::
:: ============================================::
set cvVersion=4.5.5
echo Installing OpenCV-%cvVersion%
::============================================::
:: ============================================::
mkdir opencv-%cvVersion%
cd opencv-%cvVersion%
mkdir Installation
set count=1
set cwd=%cd%
::============================================::
:: ============================================::
echo Downloading opencv from github
::download opencv from git
git clone https://github.com/opencv/opencv.git
cd opencv
::checkout appropriate cv version
git checkout %cvVersion%
cd ..
::============================================::
echo Compiling using cmake
:: download latest opencv from git
git clone https://github.com/opencv/opencv.git -b %cvVersion% --depth=1
cd opencv
:: checkout appropriate cv version
:: git checkout %cvVersion%
:: free some space on the disk
rmdir -Force -Recurse .git

:: ============================================::
echo Compiling using cmake

set cwd=%cd%

Expand All @@ -31,14 +31,13 @@ echo ============================================

mkdir build
cd build
::xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx::
::Configure OpenCV
cmake -G "Visual Studio 17 2022" -T host=x64 -DCMAKE_INSTALL_PREFIX=%cwd%/Installation -D BUILD_opencv_java=OFF -D BUILD_opencv_python=OFF ..
:: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx::
:: Configure OpenCV
cmake -G "Visual Studio 17 2022" -T host=x64 -DCMAKE_INSTALL_PREFIX=%cwd%/Installation -D BUILD_opencv_java=OFF -D BUILD_opencv_python=OFF -D BUILD_EXAMPLES=OFF -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF ..
::DO_NOT_CHANGE::
::============================================::
::Compile OpenCV in release mode
:: Compile OpenCV in release mode
cmake.exe --build . --config Debug --target INSTALL
cd ..
cd ..
cd ..

56 changes: 33 additions & 23 deletions .github/workflows/ArduinoBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

board:
# ESP32 devices for 3D matrix
- esp32
- esp32s2
- m5stick-c
Expand All @@ -35,18 +36,29 @@ jobs:
- esp32s3box

platform-version:
# ESP32 Core versions
- 1.0.6
- 2.0.0
- 2.0.1
- 2.0.2
# ESP32 Core versions for 3D matrix
#- 1.0.6
#- 2.0.0
#- 2.0.1
#- 2.0.2
- 2.0.3
- 2.0.4
- 2.0.5

include:
# 3D matrix doesn't apply to these:
- { board: seeed_wio_terminal, platform: Seeeduino, archi: samd, platform-url: 'https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json', platform-version: 1.8.2, ... }
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', platform-version: 3.0.1, ... }
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', platform-version: 3.0.2, ... }
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-version: 3.0.1, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', ... }
- { board: 'd1_mini:eesz=4M3M,xtal=80', platform: esp8266, archi: esp8266, platform-version: 3.0.2, platform-url: 'https://arduino.esp8266.com/stable/package_esp8266com_index.json', ... }
- { board: seeed_wio_terminal, platform: Seeeduino, archi: samd, platform-version: 1.8.2, platform-url: 'https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json', ... }
- { board: adafruit_hallowing, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
- { board: adafruit_hallowing_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
- { board: adafruit_pybadge_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
- { board: adafruit_pygamer_m4, platform: adafruit, archi: samd, platform-version: 1.7.10, platform-url: 'https://adafruit.github.io/arduino-board-index/package_adafruit_index.json', ... }
- { board: adafruit_feather_esp32s2_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json', ... }
- { board: adafruit_feather_esp32s3_tft, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json', ... }
- { board: adafruit_funhouse_esp32s2, platform: esp32, archi: esp32, platform-version: latest, platform-url: 'https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json', ... }
- { board: rpipico, platform: rp2040, archi: rp2040, platform-version: 2.3.3, cli-args: '--build-property compiler.cpp.extra_flags=-DSKIP_I2C_TEST', platform-url: 'https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json', ... }

# 3D matrix applies to these:
- { board: esp32, platform: esp32, archi: esp32, ... }
- { board: esp32s2, platform: esp32, archi: esp32, ... }
Expand All @@ -56,35 +68,33 @@ jobs:
- { board: esp32s3box, platform: esp32, archi: esp32, ... }

exclude:
- board: esp32s3box
platform-version: 1.0.6
- board: esp32s3box
platform-version: 2.0.0
- board: esp32s3box
platform-version: 2.0.1
- board: esp32s3box
platform-version: 2.0.2
- board: esp32s2
platform-version: 1.0.6
- board: esp32s2
platform-version: 2.0.0
# 3D matrix excludes these:
#- { board: esp32s3box, platform-version: 1.0.6 }
#- { board: esp32s3box, platform-version: 2.0.0 }
#- { board: esp32s3box, platform-version: 2.0.1 }
#- { board: esp32s3box, platform-version: 2.0.2 }
- { board: esp32s3box, platform-version: 2.0.4 }
#- { board: esp32s2, platform-version: 1.0.6 }
#- { board: esp32s2, platform-version: 2.0.0 }


fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Compile example
uses: ArminJo/arduino-test-compile@v3
uses: ArminJo/arduino-test-compile@master
with:
arduino-board-fqbn: ${{matrix.platform}}:${{matrix.archi}}:${{matrix.board}}
arduino-platform: ${{matrix.platform}}:${{matrix.archi}}@${{matrix.platform-version}}
platform-url: ${{ matrix.platform-url }}
required-libraries: ${{ matrix.required-libraries }}
build-properties: ${{ toJson(matrix.build-properties) }}
extra-arduino-cli-args: ${{ matrix.cli-args }}
#build-properties: ${{ toJson(matrix.build-properties) }}
sketch-names: ${{ env.SKETCH_NAME }}
#sketches-exclude: ${{ matrix.sketches-exclude }}

38 changes: 18 additions & 20 deletions .github/workflows/IDFBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- '**.h'
- '**.c'
- '**IDFBuild.yml'
- 'CMakeLists.txt'
pull_request:

jobs:
Expand All @@ -28,44 +29,41 @@ jobs:
- [email protected]
- [email protected]
- [email protected]
- esp32s2@v4.3.1
- esp32s2@v4.4.1
- [email protected]
- [email protected]
- [email protected]
- [email protected]

include:
- esp-idf-fqbn: [email protected]
idf-board: esp32
idf-version: v4.1
- esp-idf-fqbn: [email protected]
idf-board: esp32
idf-version: v4.2
- esp-idf-fqbn: [email protected]
idf-board: esp32
idf-version: v4.3.1
- esp-idf-fqbn: [email protected]
idf-board: esp32s2
idf-version: v4.3.1
- esp-idf-fqbn: [email protected]
idf-board: esp32s3
idf-version: v4.4.1
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v4.1 }
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v4.2 }
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v4.3.1 }
- { esp-idf-fqbn: [email protected], idf-board: esp32s2, idf-version: v4.4.1 }
- { esp-idf-fqbn: [email protected], idf-board: esp32s3, idf-version: v4.4.1 }
- { esp-idf-fqbn: [email protected], idf-board: esp32, idf-version: v5.0 }
- { esp-idf-fqbn: [email protected], idf-board: esp32s2, idf-version: v5.0 }
- { esp-idf-fqbn: [email protected], idf-board: esp32s3, idf-version: v5.0 }


fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Cache pip for ${{ matrix.esp-idf-fqbn }}
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.idf-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache espressif tools for ${{ matrix.esp-idf-fqbn }}
uses: actions/cache@v2
uses: actions/cache@v3
id: espressif
with:
path: |
Expand All @@ -74,7 +72,7 @@ jobs:

- name: Cache esp-idf for ${{ matrix.esp-idf-fqbn }}
id: cache-idf
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/esp/esp-idf
key: ${{ runner.os }}-idf-${{ matrix.idf-version }}-${{ hashFiles('**/lockfiles') }}
Expand Down
75 changes: 51 additions & 24 deletions .github/workflows/OpenCVBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- '**installOpenCV.bat'
pull_request:

workflow_dispatch:
# workflow_dispatch:

jobs:

Expand All @@ -37,62 +37,90 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: 🪟 📦 Use GNU tar instead BSD tar
if: matrix.os == 'windows-latest'
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Cache OpenCV for Windows
- name: 🪟 📦 Cache OpenCV for Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-opencv-windows
with:
path: opencv-4.5.5
key: ${{ runner.os }}-${{ hashFiles('.github/scripts/installOpenCV.bat') }}
path: D:\a\LovyanGFX\LovyanGFX\opencv-4.5.5\
key: ${{ matrix.os }}-opencv-cache

- name: Build+Install OpenCV for Windows
- name: 🪟 🏗️ Build+Install OpenCV for Windows
if: matrix.os == 'windows-latest' && steps.cache-opencv-windows.outputs.cache-hit != 'true'
shell: pwsh
run: |
.github/scripts/installOpenCV.bat
Remove-Item -Recurse -Force ${{ matrix.OpenCV_DIR }}modules
- name: Build LGFXOpenCV for Windows
if: ${{ matrix.os == 'windows-latest' }}
- name: 🪟 🏗️ Build LGFXOpenCV example for Windows
if: matrix.os == 'windows-latest'
env:
OpenCV_DIR: ${{ matrix.OpenCV_DIR }}
CC: clang
CXX: clang++
run: |
Get-PSDrive
cp .github/scripts/OpenCV.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
cd ${{ env.PROJECT_DIR }}
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 -T ClangCL ..
cmake --build . --config Debug
- name: Cache OpenCV for linux
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/cache@v2
id: opencv-cache
- name: 🐧 📦 Cache OpenCV for Linux
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v3
id: cache-opencv-linux
with:
path: ./opencv-install
key: ${{ runner.os }}-opencv-cache
path: /home/runner/work/LovyanGFX/LovyanGFX/opencv-install
key: ${{ matrix.os }}-opencv-cache

- name: Build+Install OpenCV for linux
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: 🐧 🏗️ Install OpenCV for Linux
if: matrix.os == 'ubuntu-latest'
uses: rayandrews/with-opencv-action@v1
with:
dir: ./opencv-install
cached: ${{ steps.opencv-cache.outputs.cache-hit }}
dir: /home/runner/work/LovyanGFX/LovyanGFX/opencv-install
cached: ${{ steps.cache-opencv-linux.outputs.cache-hit }}
BUILD_EXAMPLES: false
INSTALL_C_EXAMPLES: false
INSTALL_PYTHON_EXAMPLES: false
opencv-version: '4.5.5'


- name: Install OpenCV for Mac
- name: 🍏 📦 🍺 Cache brew deps for MacOS
if: matrix.os == 'macos-latest'
uses: actions/cache@v3
id: cache-opencv-macosx
with:
# Paths to cache:
# /usr/local/Homebrew - installation folder of Homebrew
# /usr/local/Cellar - installation folder of Homebrew formulae
# /usr/local/Frameworks, /usr/local/bin, /usr/local/opt - contain (links to) binaries installed by Homebrew formulae
# /usr/local/lib/python3.8 - Python3 packages installation
path: |
/usr/local/Homebrew
/usr/local/Cellar
/usr/local/Frameworks
/usr/local/bin
/usr/local/opt
/usr/local/lib/python3.8
key: ${{ matrix.os }}-opencv

- name: 🍏 🍺 Install OpenCV+CMake brew packages for MacOS
if: matrix.os == 'macos-latest' && steps.cache-opencv-macosx.outputs.cache-hit != 'true'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew install opencv cmake


- name: Build LGFXOpenCV for Mac/Linux
if: ${{ matrix.os != 'windows-latest' }}
- name: 🐧/🍏 🏗️ Build LGFXOpenCV example for Linux/MacOS
if: matrix.os != 'windows-latest'
env:
OpenCV_DIR: ${{ matrix.OpenCV_DIR }}
run: |
Expand All @@ -102,4 +130,3 @@ jobs:
cd build
cmake ..
cmake --build .
Loading

0 comments on commit 7be9f76

Please sign in to comment.