2022-04-19 19:52:12 +08:00
|
|
|
name: C++
|
2022-02-03 11:00:56 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-02-21 08:05:02 +08:00
|
|
|
branches:
|
|
|
|
- master
|
2023-07-23 21:02:21 +08:00
|
|
|
paths:
|
|
|
|
- ".github/workflows/build_cpp.yml"
|
|
|
|
- "**.cpp"
|
|
|
|
- "**.h"
|
|
|
|
- "**.c"
|
|
|
|
- "**.cu"
|
|
|
|
- "**.cmake"
|
|
|
|
- "**CMakeLists.txt"
|
2022-02-21 08:05:02 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-07-23 21:02:21 +08:00
|
|
|
paths:
|
|
|
|
- ".github/workflows/build_cpp.yml"
|
|
|
|
- "**.cpp"
|
|
|
|
- "**.h"
|
|
|
|
- "**.c"
|
|
|
|
- "**.cu"
|
|
|
|
- "**.cmake"
|
|
|
|
- "**CMakeLists.txt"
|
2022-02-03 11:00:56 +08:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2022-02-14 01:06:04 +08:00
|
|
|
working-directory: dlib/test
|
2022-02-03 11:00:56 +08:00
|
|
|
|
|
|
|
jobs:
|
2023-03-30 10:12:47 +08:00
|
|
|
ubuntu-latest-gcc-default-cmake-3-8-ffmpeg5:
|
2022-02-14 01:06:04 +08:00
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-03-25 10:25:40 +08:00
|
|
|
|
2023-03-30 10:12:47 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install libwebp-dev make yasm
|
|
|
|
|
|
|
|
- name: Cache cmake 3.8.0
|
|
|
|
uses: actions/cache@v3
|
2023-03-25 10:25:40 +08:00
|
|
|
id: cache-cmake-download
|
|
|
|
with:
|
|
|
|
# cache this folder:
|
|
|
|
path: ~/cmake-3.8.0-Linux-x86_64
|
|
|
|
key: cmake-3.8.0_try3
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2023-03-25 10:25:40 +08:00
|
|
|
- run: |
|
|
|
|
# Get the minimum version of cmake dlib supports
|
|
|
|
wget https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.tar.gz
|
|
|
|
tar -xf cmake-3.8.0-Linux-x86_64.tar.gz -C ~
|
|
|
|
if: steps.cache-cmake-download.outputs.cache-hit != 'true'
|
|
|
|
|
2023-03-30 10:12:47 +08:00
|
|
|
- name: Cache FFmpeg 5
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-ffmpeg5
|
|
|
|
with:
|
|
|
|
path: /home/runner/ffmpeg-n5.1.3_installation
|
|
|
|
key: ffmpeg-n5.1.3_try4
|
|
|
|
|
|
|
|
- name: Build FFmpeg 5
|
|
|
|
if: steps.cache-ffmpeg5.outputs.cache-hit != 'true'
|
2022-04-19 19:52:12 +08:00
|
|
|
run: |
|
2023-03-30 10:12:47 +08:00
|
|
|
wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n5.1.3.tar.gz
|
|
|
|
tar -xf n5.1.3.tar.gz
|
|
|
|
cd FFmpeg-n5.1.3
|
|
|
|
./configure --prefix=/home/runner/ffmpeg-n5.1.3_installation --disable-doc --disable-programs
|
|
|
|
make -j4
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Configure
|
2023-03-25 10:25:40 +08:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2023-03-30 10:12:47 +08:00
|
|
|
~/cmake-3.8.0-Linux-x86_64/bin/cmake -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation ..
|
|
|
|
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
make -j4 dtest
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Test
|
2023-03-25 10:25:40 +08:00
|
|
|
run: build/dtest --runall -q
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build examples, etc
|
2023-03-25 10:25:40 +08:00
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
make -j2
|
2022-02-03 11:00:56 +08:00
|
|
|
|
2023-03-26 10:52:41 +08:00
|
|
|
ubuntu-latest-gcc-11-blas:
|
2022-02-14 01:06:04 +08:00
|
|
|
runs-on: 'ubuntu-latest'
|
2022-02-03 11:00:56 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-06-18 10:19:11 +08:00
|
|
|
- name: Install dependencies
|
2022-02-14 01:06:04 +08:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
2023-01-30 09:17:34 +08:00
|
|
|
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
|
2023-03-26 10:52:41 +08:00
|
|
|
sudo apt install libopenblas-dev liblapack-dev
|
2022-04-19 19:52:12 +08:00
|
|
|
- name: Install gcc 11
|
|
|
|
run: |
|
2022-02-14 01:06:04 +08:00
|
|
|
sudo apt install gcc-11 g++-11
|
|
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
|
|
|
|
- name: Configure
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake ${{ github.workspace }}/dlib/test -B build
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target dtest --parallel 4
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Test
|
2023-03-25 10:25:40 +08:00
|
|
|
run: build/dtest --runall -q
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build examples, etc
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --parallel 2
|
2022-02-03 11:00:56 +08:00
|
|
|
|
2023-03-26 10:52:41 +08:00
|
|
|
# Test the BLAS bindings
|
|
|
|
- name: Configure BLAS binding tests
|
|
|
|
run: cmake ${{ github.workspace }}/dlib/test/blas_bindings -B build_blas_bindings
|
|
|
|
- name: Build blas binding tests
|
|
|
|
run: cmake --build build_blas_bindings --config Debug --parallel 4
|
|
|
|
- name: Test BLAS bindings
|
|
|
|
run: build_blas_bindings/dtest --runall -q
|
|
|
|
|
2023-04-04 20:59:27 +08:00
|
|
|
ubuntu-20_04-gcc-7:
|
|
|
|
runs-on: 'ubuntu-20.04'
|
2023-01-03 23:13:54 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2023-01-03 23:13:54 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
2023-03-30 10:12:47 +08:00
|
|
|
sudo apt install libwebp-dev make yasm
|
|
|
|
|
2023-01-03 23:13:54 +08:00
|
|
|
- name: Install gcc 7
|
|
|
|
run: |
|
|
|
|
sudo apt install gcc-7 g++-7
|
2023-03-30 10:12:47 +08:00
|
|
|
|
|
|
|
- name: Cache FFmpeg 3.2.18
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-ffmpeg3
|
|
|
|
with:
|
|
|
|
path: /home/runner/ffmpeg-n3.2.18_installation
|
|
|
|
key: ffmpeg-n3.2.18_try1
|
|
|
|
|
|
|
|
- name: Build FFmpeg 3.2.18
|
|
|
|
if: steps.cache-ffmpeg3.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n3.2.18.tar.gz
|
|
|
|
tar -xf n3.2.18.tar.gz
|
|
|
|
cd FFmpeg-n3.2.18
|
|
|
|
./configure --prefix=/home/runner/ffmpeg-n3.2.18_installation --disable-doc --disable-programs
|
|
|
|
make -j4
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
2023-01-03 23:13:54 +08:00
|
|
|
- name: Configure
|
2023-04-04 20:59:27 +08:00
|
|
|
run: |
|
|
|
|
export CC=/usr/bin/gcc-7
|
|
|
|
export CXX=/usr/bin/g++-7
|
|
|
|
cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2023-01-03 23:13:54 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target dtest --parallel 4
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2023-01-03 23:13:54 +08:00
|
|
|
- name: Test
|
2023-03-25 10:25:40 +08:00
|
|
|
run: build/dtest --runall -q
|
2023-03-30 10:12:47 +08:00
|
|
|
|
2023-01-03 23:13:54 +08:00
|
|
|
- name: Build examples, etc
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --parallel 2
|
2023-01-03 23:13:54 +08:00
|
|
|
|
2023-03-26 10:52:41 +08:00
|
|
|
# Test cmake scrips can build standalone dlib as a shared library
|
|
|
|
- name: Configure dlib as shared library
|
2023-03-30 10:12:47 +08:00
|
|
|
run: cmake ${{ github.workspace }}/dlib -B build_dlib_shared -DBUILD_SHARED_LIBS=1 -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
|
|
|
|
|
2023-03-26 10:52:41 +08:00
|
|
|
- name: Build dlib as shared library
|
|
|
|
run: cmake --build build_dlib_shared --parallel 4
|
|
|
|
|
|
|
|
ubuntu-latest-clang-default-avx:
|
2022-02-14 01:06:04 +08:00
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-06-18 10:19:11 +08:00
|
|
|
- name: Install dependencies
|
2022-04-19 19:52:12 +08:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
2023-01-30 09:17:34 +08:00
|
|
|
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
|
2022-02-03 11:00:56 +08:00
|
|
|
- name: Configure
|
2022-02-07 10:36:56 +08:00
|
|
|
run: |
|
2022-02-14 01:06:04 +08:00
|
|
|
export CC=/usr/bin/clang
|
|
|
|
export CXX=/usr/bin/clang++
|
2023-03-26 10:52:41 +08:00
|
|
|
cmake ${{ github.workspace }}/dlib/test -B build -DUSE_AVX_INSTRUCTIONS=1
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target dtest --parallel 4
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Test
|
2023-03-25 10:25:40 +08:00
|
|
|
run: build/dtest --runall -q
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build examples, etc
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --parallel 2
|
2022-02-03 11:00:56 +08:00
|
|
|
|
2022-02-14 01:06:04 +08:00
|
|
|
windows-latest:
|
|
|
|
runs-on: 'windows-latest'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Configure
|
2022-11-29 09:10:47 +08:00
|
|
|
run: |
|
|
|
|
# don't use CMake 3.25.0 https://gitlab.kitware.com/cmake/cmake/-/issues/23975
|
|
|
|
pip3 install cmake==3.24.0
|
2023-03-25 10:25:40 +08:00
|
|
|
cmake . -B build
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target dtest --parallel 4
|
2022-02-03 11:00:56 +08:00
|
|
|
- name: Test
|
2023-03-25 10:25:40 +08:00
|
|
|
run: build/Release/dtest.exe --runall -q
|
2022-04-30 09:49:57 +08:00
|
|
|
- name: Build ancillary tools
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target imglab htmlify dtoc --parallel 4
|
2022-02-07 08:47:05 +08:00
|
|
|
|
2022-08-01 05:45:46 +08:00
|
|
|
windows-2019:
|
|
|
|
runs-on: 'windows-2019'
|
2022-07-13 08:40:11 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Configure
|
2022-11-29 09:10:47 +08:00
|
|
|
run: |
|
|
|
|
# don't use CMake 3.25.0 https://gitlab.kitware.com/cmake/cmake/-/issues/23975
|
|
|
|
pip3 install cmake==3.24.0
|
2023-03-25 10:25:40 +08:00
|
|
|
cmake . -B build
|
2022-07-13 08:40:11 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Debug --target dtest --parallel 4
|
2022-07-13 08:40:11 +08:00
|
|
|
- name: Build ancillary tools
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target imglab htmlify dtoc --parallel 4
|
2022-07-13 08:40:11 +08:00
|
|
|
|
2022-02-14 01:06:04 +08:00
|
|
|
macos-latest:
|
|
|
|
runs-on: 'macos-latest'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Configure
|
|
|
|
# MacOS machines often come with low quality BLAS libraries installed, so don't use those.
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake ${{ github.workspace }}/dlib/test -B build -DDLIB_USE_BLAS=0 -DDLIB_USE_LAPACK=0
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Build just tests
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --target dtest --parallel 4
|
2022-02-14 01:06:04 +08:00
|
|
|
- name: Test
|
2023-03-25 10:25:40 +08:00
|
|
|
run: build/dtest --runall --no_test_timer -q
|
2022-02-07 08:47:05 +08:00
|
|
|
- name: Build examples, etc
|
2023-03-25 10:25:40 +08:00
|
|
|
run: cmake --build build --config Release --parallel 2
|