Skip to content

Commit

Permalink
updated CI-pipline to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jkriege2 committed May 9, 2024
1 parent 0abc9e5 commit 75efbdb
Show file tree
Hide file tree
Showing 9 changed files with 268 additions and 214 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This is a basic workflow to help you get started with Actions

name: Doxygen build&deploy

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get update --fix-missing
sudo apt-get install -f
sudo apt -y install build-essential doxygen graphviz doxygen-latex libclang-common-10-dev libclang-10-dev fonts-freefont-ttf
doxygen -v
- name: Update Doxygen to 1.9.8
run: |
currDir=`pwd`
cd $GITHUB_WORKSPACE
mkdir doxygen
wget -O - https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.linux.bin.tar.gz | tar --strip-components=1 -xz -C doxygen
export PATH=$GITHUB_WORKSPACE/doxygen/bin:${PATH}
echo PATH=$PATH
cd $currDir
$GITHUB_WORKSPACE/doxygen/bin/doxygen --version
- name: Run Doxygen
run: |
$GITHUB_WORKSPACE/doxygen/bin/doxygen --version
cd doc
pwd
ls
$GITHUB_WORKSPACE/doxygen/bin/doxygen
pwd
ls
ls -R
- name: Create .nojekyll (ensures pages with underscores work on gh pages)
run: |
pwd
touch doc/html/.nojekyll
shell: bash

- name: 🚀 Deploy to Github-Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
#github_token: ${{ secrets.GH_PAGES_SECRET }}
ssh-key: ${{ secrets.TINYMAT_DEPLOY_KEY }}
branch: gh-pages
folder: doc/html

73 changes: 73 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: BUILD-LINUX-CI

on: [push, pull_request]

permissions:
checks: write

jobs:
ci:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
name: LINUX-CI
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- {gen: Unix Makefiles, shared: ON, ccompiler: gcc, cxxcompiler: g++}
- {gen: Unix Makefiles, shared: OFF, ccompiler: gcc, cxxcompiler: g++}
- {gen: Unix Makefiles, shared: ON, ccompiler: clang, cxxcompiler: clang++}
- {gen: Unix Makefiles, shared: OFF, ccompiler: clang, cxxcompiler: clang++}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Configure
run: |
mkdir install
cmake -G "${{matrix.gen}}" -DBUILD_SHARED_LIBS=${{matrix.shared}} "-DCMAKE_INSTALL_PREFIX=./install" -DCMAKE_CXX_COMPILER=${{matrix.cxxcompiler}} -DCMAKE_C_COMPILER=${{matrix.ccompiler}} -B build
- name: Build Release
run: |
cmake --build build --config Release --verbose
- name: Install Release
run: |
cmake --install build --config Release
cd install
ls -R
- name: Build Debug
run: |
cmake -G "${{matrix.gen}}" -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=${{matrix.shared}} "-DTinyMAT_BUILD_EXAMPLES=OFF" -DCMAKE_CXX_COMPILER=${{matrix.cxxcompiler}} -DCMAKE_C_COMPILER=${{matrix.ccompiler}} -DCMAKE_CXX_FLAGS_DEBUG:STRING="-Wall" -DCMAKE_C_FLAGS_DEBUG:STRING="-Wall" -B build_debug
cmake --build build_debug --config Debug --verbose
- name: Test CMake-build against TinyMAT
run: |
cd examples
cd extcmake_tinymat_test
mkdir build
cd build
cmake -G "${{matrix.gen}}" "-DCMAKE_PREFIX_PATH=${{github.workspace}}/install/" -DCMAKE_CXX_COMPILER=${{matrix.cxxcompiler}} -DCMAKE_C_COMPILER=${{matrix.ccompiler}} -B . -S ..
cmake --build . --config Release --verbose
# - name: Test CMake-build against TinyMAT, using FetchContent-API
# if: success() || failure() # always run even if the previous step fails
# run: |
# cd examples
# cd extcmake_fetchcontent_tinytiff_test
# mkdir build
# cd build
# cmake -G "${{matrix.gen}}" -DCMAKE_CXX_COMPILER=${{matrix.cxxcompiler}} -DCMAKE_C_COMPILER=${{matrix.ccompiler}} -B . -S ..
# cmake --build . --config Release --verbose

# - name: Run Release tests
# run: |
# cd install
# cd bin
# pwd
# ls
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{github.workspace}}/install/lib/
# ./tinytiffwriter_test --simple
# ./tinytiffreader_test --simple
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v4
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: '**/install/bin/*.xml'
70 changes: 70 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: BUILD-MSVC-CI

on: [push, pull_request]

permissions:
checks: write

jobs:
ci:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
name: MSVC 2022
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- {gen: Visual Studio 17 2022, arch: Win32, shared: ON}
- {gen: Visual Studio 17 2022, arch: Win32, shared: OFF}
- {gen: Visual Studio 17 2022, arch: x64, shared: ON}
- {gen: Visual Studio 17 2022, arch: x64, shared: OFF}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Configure
run: |
mkdir install
cmake -G "${{matrix.gen}}" -A ${{matrix.arch}} -DBUILD_SHARED_LIBS=${{matrix.shared}} "-DCMAKE_INSTALL_PREFIX=./install" -B build
- name: Build Release
run: |
cmake --build build --config Release --verbose
- name: Install Release
run: |
cmake --install build --config Release
cd install
ls -R
- name: Test CMake-build against TinyMAT
run: |
cd examples
cd extcmake_tinymat_test
mkdir build
cd build
pwd
echo ${{github.workspace}}
cmake -G "${{matrix.gen}}" -A ${{matrix.arch}} "-DCMAKE_PREFIX_PATH=${{github.workspace}}/install/" -B . -S ..
cmake --build . --config Release --verbose
# - name: Test CMake-build against TinyMAT, using FetchContent-API
# if: success() || failure() # always run even if the previous step fails
# run: |
# cd examples
# cd extcmake_tinymat_test
# mkdir build
# cd build
# cmake -G "${{matrix.gen}}" -A ${{matrix.arch}} -B . -S ..
# cmake --build . --config Release --verbose

# - name: Run Release tests
# run: |
# cd install
# cd bin
# pwd
# ls
# .\tinytiffwriter_test --simple
# .\tinytiffreader_test --simple
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v4
# if: success() || failure() # always run even if the previous step fails
# with:
# report_paths: '**/install/bin/*.xml'
51 changes: 51 additions & 0 deletions .github/workflows/msvc-codeanalysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "MSVC-CodeAnalysis"

on: [push, pull_request]


env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
config: 'Debug'

jobs:
analyze:
name: Analyze
runs-on: windows-latest

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

- name: Configure CMake
run: cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }} "-DTinyMAT_BUILD_SHARED_LIBS:BOOL=OFF" "-DTinyMAT_BUILD_STATIC_LIBS:BOOL=ON" "-DBUILD_SHARED_LIBS:BOOL=ON" "-DTinyMAT_BUILD_EXAMPLES:BOOL=OFF"

- name: Build CMake
run: cmake --build ${{ env.build }} --config ${{ env.config }}

- name: Run MSVC Code Analysis
uses: microsoft/[email protected]
# Provide a unique ID to access the sarif output path
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: ${{ env.config }}
# Ruleset file that will determine what checks will be run
ruleset: NativeRecommendedRules.ruleset
# Paths to ignore analysis of CMake targets and includes
# ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test

# Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

# Upload SARIF file as an Artifact to download and view
- name: Upload SARIF as an Artifact
uses: actions/upload-artifact@v2
with:
name: sarif-file
path: ${{ steps.run-analysis.outputs.sarif }}


94 changes: 0 additions & 94 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)

######################################################################################################
# Project Name and Version
project(libTinyMAT LANGUAGES CXX VERSION 2.1.0.0)
project(libTinyMAT LANGUAGES CXX VERSION 3.0.0.0)

# set search path for CMake files
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

find_package(Qt5 COMPONENTS Core REQUIRED)
find_package(OpenCV)

######################################################################################################
# ensure a build-type is set (Release is default)
Expand All @@ -20,9 +18,11 @@ if(NOT DEFINED TinyMAT_FILEBACKEND_USE_MEMORY_CACHE)
option(TinyMAT_FILEBACKEND_USE_MEMORY_CACHE "Build with a file-backend, that caches the output in memory, before writing to disk (sets TINYMAT_WRITE_VIA_MEMORY when building)" ON)
endif()
if(NOT DEFINED TinyMAT_OPENCV_SUPPORT)
find_package(OpenCV)
option(TinyMAT_OPENCV_SUPPORT "Build with Support for OpenCV" ${OpenCV_FOUND})
endif()
if(NOT DEFINED TinyMAT_QT5_SUPPORT)
find_package(Qt5 COMPONENTS Core REQUIRED)
option(TinyMAT_QT5_SUPPORT "Build with Support for Qt5" ${Qt5_FOUND})
endif()
if(NOT DEFINED TinyMAT_BUILD_SHARED_LIBS)
Expand Down
Loading

0 comments on commit 75efbdb

Please sign in to comment.