Skip to content

Commit

Permalink
[CI] build dependencies in release-only mode (AlexeyAB#8304)
Browse files Browse the repository at this point in the history
* enable release-only triplet on windows

* add debug tmate

* use release-only triplets also for linux and osx
  • Loading branch information
cenit authored Dec 22, 2021
1 parent 967b72d commit 57910b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Darknet Continuous Integration
on:
push:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
schedule:
- cron: '0 0 * * *'

Expand Down Expand Up @@ -71,6 +76,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}

- uses: lukka/get-cmake@latest

- name: Update apt
Expand Down Expand Up @@ -370,6 +379,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}

- name: Install dependencies
run: brew install libomp yasm nasm

Expand Down Expand Up @@ -465,6 +478,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}

- uses: lukka/get-cmake@latest

- name: 'Setup vcpkg and NuGet artifacts backend'
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ option(VCPKG_USE_OPENCV2 "Use legacy OpenCV 2" OFF)
option(VCPKG_USE_OPENCV3 "Use legacy OpenCV 3" OFF)
option(VCPKG_USE_OPENCV4 "Use OpenCV 4" ON)

if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET})
message(STATUS "Setting default vcpkg target triplet to $ENV{VCPKG_DEFAULT_TRIPLET}")
set(VCPKG_TARGET_TRIPLET $ENV{VCPKG_DEFAULT_TRIPLET})
endif()

if(VCPKG_USE_OPENCV4 AND VCPKG_USE_OPENCV2)
message(STATUS "You required vcpkg feature related to OpenCV 2 but forgot to turn off those for OpenCV 4, doing that for you")
set(VCPKG_USE_OPENCV4 OFF CACHE BOOL "Use OpenCV 4" FORCE)
Expand Down
8 changes: 7 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ if (($IsLinux -or $IsMacOS) -and ($ForceGCCVersion -gt 0)) {
}

if (($IsWindows -or $IsWindowsPowerShell) -and (-Not $env:VCPKG_DEFAULT_TRIPLET)) {
$env:VCPKG_DEFAULT_TRIPLET = "x64-windows"
$env:VCPKG_DEFAULT_TRIPLET = "x64-windows-release"
}
elseif ($IsMacOS -and (-Not $env:VCPKG_DEFAULT_TRIPLET)) {
$env:VCPKG_DEFAULT_TRIPLET = "x64-osx-release"
}
elseif ($IsLinux -and (-Not $env:VCPKG_DEFAULT_TRIPLET)) {
$env:VCPKG_DEFAULT_TRIPLET = "x64-linux-release"
}

if ($EnableCUDA) {
Expand Down

0 comments on commit 57910b1

Please sign in to comment.