From 565f8886040f1c3255dc47fef8eed20de36ab228 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Wed, 8 May 2024 10:24:36 +0200 Subject: [PATCH] add build-action for Linux with gcc and clang --- .github/workflows/build_linux.yml | 68 +++++++++++++++++++ .../{build_msvc.yml => build_windows.yml} | 10 +-- 2 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build_linux.yml rename .github/workflows/{build_msvc.yml => build_windows.yml} (82%) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml new file mode 100644 index 0000000..8780a58 --- /dev/null +++ b/.github/workflows/build_linux.yml @@ -0,0 +1,68 @@ +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: Test CMake-build against TinyTIFF + run: | + cd tests + cd extcmake_tinytiff_test + md build + cd build + 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 TinyTIFF, using FetchContent-API + if: success() || failure() # always run even if the previous step fails + run: | + cd tests + cd extcmake_fetchcontent_tinytiff_test + md 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' diff --git a/.github/workflows/build_msvc.yml b/.github/workflows/build_windows.yml similarity index 82% rename from .github/workflows/build_msvc.yml rename to .github/workflows/build_windows.yml index e2e495f..fbff4d8 100644 --- a/.github/workflows/build_msvc.yml +++ b/.github/workflows/build_windows.yml @@ -16,17 +16,17 @@ jobs: fail-fast: false matrix: include: - - {gen: Visual Studio 17 2022, arch: Win32, shared: ON, static: OFF} - - {gen: Visual Studio 17 2022, arch: Win32, shared: OFF, static: ON} - - {gen: Visual Studio 17 2022, arch: x64, shared: ON, static: OFF} - - {gen: Visual Studio 17 2022, arch: x64, shared: OFF, static: ON} + - {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}} -DTinyTIFF_BUILD_SHARED_LIBS=${{matrix.shared}} -DTinyTIFF_BUILD_STATIC_LIBS=${{matrix.static}} -DBUILD_SHARED_LIBS=${{matrix.shared}} "-DCMAKE_INSTALL_PREFIX=./install" -B build + 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