Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipeline for Windows and Linux #3

Merged
merged 59 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
70b45b6
Pipeline vcpkg setup
blamacaz Sep 27, 2024
308ae7d
Vcpkg setup
blamacaz Sep 27, 2024
9c3ab17
Vcpkg setup
blamacaz Sep 27, 2024
a0b2ed9
Vcpkg setup
blamacaz Sep 27, 2024
f7e1832
Setup
blamacaz Sep 27, 2024
204658c
Build and test
blamacaz Sep 27, 2024
95faf0e
Install linux packages
blamacaz Sep 27, 2024
433c2c7
Add sudo
blamacaz Sep 27, 2024
d70c165
Install OpenCV needed packages
blamacaz Sep 27, 2024
d57c858
Separete build and test job
blamacaz Sep 30, 2024
6a8b9c0
Fix path
blamacaz Sep 30, 2024
0040cd8
Output on test failure
blamacaz Sep 30, 2024
1b356d0
Add permissions
blamacaz Sep 30, 2024
203ac7f
Update .yml
blamacaz Sep 30, 2024
9ed048a
Update .yml
blamacaz Sep 30, 2024
c880d87
update.yml
blamacaz Sep 30, 2024
337a546
Update .yml
blamacaz Sep 30, 2024
d24a743
Update .yml
blamacaz Sep 30, 2024
acae8dc
Update .yml
blamacaz Sep 30, 2024
eb6307d
update .yml
blamacaz Sep 30, 2024
c10aac1
Reduce test data
blamacaz Oct 1, 2024
776ee5c
Specify artifact paths
blamacaz Oct 1, 2024
4fbb70e
Multi OS
blamacaz Oct 1, 2024
a077662
Multi OS
blamacaz Oct 1, 2024
111195e
Multi OS
blamacaz Oct 1, 2024
f2b656c
Multi OS
blamacaz Oct 1, 2024
abd3f8b
Test
blamacaz Oct 1, 2024
57f3ab2
test
blamacaz Oct 1, 2024
4d25b65
test
blamacaz Oct 1, 2024
55ad7da
test
blamacaz Oct 1, 2024
46b6224
test
blamacaz Oct 1, 2024
81d9bba
test
blamacaz Oct 1, 2024
eecfece
test windows
blamacaz Oct 1, 2024
dfa2335
test
blamacaz Oct 1, 2024
2307281
test
blamacaz Oct 1, 2024
af50c61
test
blamacaz Oct 1, 2024
c490a27
test
blamacaz Oct 1, 2024
151fba5
test
blamacaz Oct 1, 2024
875bdfe
test
blamacaz Oct 2, 2024
fb234bc
test macos
blamacaz Oct 2, 2024
a9082f0
test macos
blamacaz Oct 2, 2024
588d997
test macos
blamacaz Oct 2, 2024
6e031b7
test macos
blamacaz Oct 2, 2024
8c167b5
test macos
blamacaz Oct 2, 2024
a705627
test macos
blamacaz Oct 2, 2024
e367164
Extra print
blamacaz Oct 2, 2024
6e769d0
test
blamacaz Oct 3, 2024
e156ee8
Test
blamacaz Oct 3, 2024
a23fc5b
test
blamacaz Oct 3, 2024
48521e5
Test
blamacaz Oct 3, 2024
9dc57c0
test
blamacaz Oct 3, 2024
348ca99
test
blamacaz Oct 3, 2024
ceb1532
test
blamacaz Oct 3, 2024
c4060e8
test
blamacaz Oct 3, 2024
3e019db
test
blamacaz Oct 3, 2024
e8c66c9
test
blamacaz Oct 4, 2024
4a148aa
test
blamacaz Oct 6, 2024
f4dad7a
test
blamacaz Oct 6, 2024
d18c874
Set test job conditions
blamacaz Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: C/C++ CI

on:
push:
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
#ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-latest
triplet: x64-linux
# - os: macos-latest
# triplet: x64-osx

continue-on-error: true

env:
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'

steps:
- name: Set OS environment variable in lowercase letters
run: echo "CURRENT_OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
shell: bash

- name: Set up cache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- uses: actions/checkout@v4

- name: Create vcpkg default binary cache
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
mkdir -p ${{ github.workspace }}\vcpkg\bincache
else
mkdir -p ${{ github.workspace }}/vcpkg/bincache
fi
shell: bash

- uses: lukka/get-cmake@latest

- name: Set up vcpkg
uses: lukka/run-vcpkg@v4
with:
setupOnly: true
vcpkgGitCommitId: 0affe8710a4a5b26328e909fe1ad7146df39d108

# Restore vpkg cache
- name: Restore vcpkg
uses: actions/cache@v4
with:
path: |
${{ env._VCPKG_ }}
!${{ env._VCPKG_ }}/buildtrees
!${{ env._VCPKG_ }}/packages
!${{ env._VCPKG_ }}/downloads
!${{ env._VCPKG_ }}/installed
key: |
${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}

# Ensure that the developer command promt is present on Windows runners
- uses: ilammy/msvc-dev-cmd@v1

- name: Install packages
if: runner.os == 'Linux'
run: sudo apt-get install -y libxi-dev libxtst-dev bison gperf libgles2-mesa-dev libxrandr-dev libxcursor-dev libxdamage-dev libxinerama-dev nasm

- if: runner.os == 'macOS'
run: brew install nasm

- name: Restore from cache the dependencies and generate project files
run: |
cmake -DBUILD_EXAMPLE_APP=ON -DBUILD_TESTS=ON --preset ${{ env.CURRENT_OS }}-release

- name: Build (Release configuration)
run: |
cmake --build --preset ${{ env.CURRENT_OS }}-release

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts-${{ env.CURRENT_OS }}
path: |
bin/build/${{ env.CURRENT_OS }}-release/example
bin/build/${{ env.CURRENT_OS }}-release/test/Iris.Tests
bin/build/${{ env.CURRENT_OS }}-release/test/AddressSanitizer.Tests
bin/build/${{ env.CURRENT_OS }}-release/CTestTestfile.cmake

test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
#ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-latest
triplet: x64-linux
# - os: macos-latest
# triplet: x64-osx

continue-on-error: true

if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')

steps:
- name: Set environment variable in lowercase letters
run: echo "CURRENT_OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
shell: bash

- uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts-${{ env.CURRENT_OS }}
path: bin/build/${{ env.CURRENT_OS }}-release

- name: Set permissions
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libegl1-mesa && sudo chmod +x bin/build/linux-release/test/Iris.Tests/iris_tests
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod 755 bin/build/macos-release/test/Iris.Tests/iris_tests
fi
shell: bash

- name: Test
run: |
ctest --preset test-${{ env.CURRENT_OS }}

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ if(BUILD_TESTS)
message("Build tests")
enable_testing()
add_subdirectory("test/Iris.Tests")
add_subdirectory("test/AddressSanitizer.Tests")
endif()

# ---------------------------------------------------------------------------------------
Expand Down
17 changes: 13 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 3,
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
Expand Down Expand Up @@ -106,7 +106,6 @@
"description": "Target Windows with the Visual Studio development environment.",
"inherits": [ "windows-debug" ],
"cacheVariables": {
"WINDOWS_PIPELINE": true,
"CMAKE_BUILD_TYPE": "Release"
}
},
Expand Down Expand Up @@ -178,15 +177,25 @@
],
"testPresets": [
{
"name": "videolib-linux",
"name": "test-linux",
"configurePreset": "linux-release",
"output": {"outputOnFailure": true},
"environment": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
{
"name": "videolib-windows",
"name": "test-windows",
"configurePreset": "windows-release",
"output": { "outputOnFailure": true },
"environment": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
{
"name": "test-macos",
"configurePreset": "macos-release",
"output": { "outputOnFailure": true },
"environment": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
2 changes: 1 addition & 1 deletion src/CDLuminance.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace iris
/// <param name="flashThreshold"></param>
CDLuminance(EA::EACC::Utils::FrameConverter* converter, const short& fps, const cv::Size& frameSize, FlashParams* params);
void SetCurrentFrame(const IrisFrame& irisFrame) override;
void SetCurrentFrame(cv::Mat* bgrFrame);
void SetCurrentFrame (cv::Mat* bgrFrame) override;

~CDLuminance();
protected:
Expand Down
2 changes: 1 addition & 1 deletion src/RelativeLuminance.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace iris


void SetCurrentFrame(const IrisFrame& irisFrame) override;
void SetCurrentFrame(cv::Mat* bgrFrame);
void SetCurrentFrame(cv::Mat* bgrFrame) override;

~RelativeLuminance();
protected:
Expand Down
94 changes: 0 additions & 94 deletions src/TransitionEvaluator.cpp

This file was deleted.

Loading
Loading