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

CI simplification and refactor #323

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 0 additions & 54 deletions .github/workflows/docs.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/linux.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/osx.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
name: OS ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
shared: [ON, OFF]

steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Support longpaths
run: git config --system core.longpaths true
if: matrix.os == 'windows-latest'
- uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
environment-file: scripts/ci/environment.yml
environment-name: "build"
cache-environment: true
cache-downloads: true

- name: Setup
shell: bash -l {0}
run: |
mkdir build

- name: CMake
shell: bash -l {0}

run: |

if [ "$RUNNER_OS" == "Windows" ]; then
export CC=cl.exe
export CXX=cl.exe
export ENTWINE_LIBRARY_PATH=$CONDA_PREFIX/Library/lib
export ENTWINE_INCLUDE_PATH=$CONDA_PREFIX/Library/include
else
export ENTWINE_LIBRARY_PATH=$CONDA_PREFIX/lib
export ENTWINE_INCLUDE_PATH=$CONDA_PREFIX/include
fi

cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
-Dgtest_force_shared_crt=ON \
-DBUILD_TESTING=ON \
-DCMAKE_LIBRARY_PATH:FILEPATH=$ENTWINE_LIBRARY_PATH \
-DCMAKE_INCLUDE_PATH:FILEPATH=$ENTWINE_INCLUDE_PATH \
-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 \
-DBUILD_SHARED_LIBS=ON \
..


working-directory: ./build

- name: Compile
shell: bash -l {0}
run: |
ninja
working-directory: ./build

- name: Test
shell: bash -l {0}
run: |
ctest -VV --rerun-failed --output-on-failure
working-directory: ./build

80 changes: 0 additions & 80 deletions .github/workflows/win.yml

This file was deleted.

9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,16 @@ set_target_properties(
#
# Test
#
option(WITH_TESTS "Choose if Entwine unit tests should be built" TRUE)
if (WITH_TESTS)
option(BUILD_TESTING "Choose if Entwine unit tests should be built" TRUE)
if(DEFINED WITH_TESTS)
message(DEPRECATION "WITH_TESTS has been replaced with the standard CMake BUILD_TESTING variable")
set(BUILD_TESTING ${WITH_TESTS})
endif()
if (BUILD_TESTING)
message("Configuring with unit tests")
enable_testing()
set(GOOGLETEST_VERSION 1.13.0)
add_subdirectory("${PROJECT_SOURCE_DIR}/test/googletest-1.13.0/googletest")

add_subdirectory(test)
else()
message("Configuring with NO unit tests")
Expand Down
Loading
Loading