Skip to content

Experimenting with consts #38

Experimenting with consts

Experimenting with consts #38

Workflow file for this run

name: Main
on:
push:
paths-ignore:
- '.gitignore'
- '*.md'
jobs:
lint:
name: 🧹 Lint / πŸ“œ C++
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '15'
exclude-regex: 'extern'
build:
strategy:
fail-fast: false
matrix:
build_type: ['Debug', 'Release']
config:
- { name: '🍏 macOS Clang', os: macos-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@v4
with:
submodules: recursive
- name: Install Dependencies (macOS)
if: matrix.config.os == 'macos-latest'
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-20.04'
run: |
sudo apt-get update
sudo apt-get install -y ccache ninja-build
- name: Install Dependencies (Windows)
if: matrix.config.os == 'windows-latest'
run: |
choco upgrade ccache ninja
- name: Setup MSVC (Windows)
if: matrix.config.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: ccache
uses: hendrikmuhs/[email protected]
with:
max-size: '10G'
key: ${{ matrix.config.os }}-${{ matrix.build_type }}
- name: Setup OpenCV
if: matrix.config.os == 'ubuntu-20.04'
uses: Dovyski/[email protected]
with:
opencv-version: '4.2.0'
- 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: >
mkdir GDExtension-build
cmake
-B GDExtension-build
-G "Ninja"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
--install-prefix ${{ github.workspace }}/install-${{ matrix.build_type }}
.
- name: Build
run: cmake --build GDExtension-build
- name: Install
run: cmake --install GDExtension-build
- name: Upload artifact (Debug)
if: matrix.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-Debug
path: |
${{ 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 }}/Demo/bin/*