Skip to content

Commit

Permalink
update unittest workflow with new dependency handling
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Jan 8, 2024
1 parent 46787b6 commit accc8ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
dependencies/benchmark-install
dependencies/boost
dependencies/googletest-install
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/dependencies/benchmark/CMakeLists.txt', '**/dependencies/googletest/CMakeLists.txt') }} # Unique key based on OS and CMake file
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/dependencies/benchmark/CMakeLists.txt', '**/dependencies/boost/CMakeLists.txt', '**/dependencies/googletest/CMakeLists.txt') }} # Unique key based on OS and CMake files

- name: Configure, Build, and Install Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Configure, and Build Loki
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARKING:BOOL=TRUE -S . -B build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARKING=ON -S . -B build
cmake --build build -j$(nproc)
# Run benchmarks and store the output to a file
Expand Down
42 changes: 15 additions & 27 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,26 @@ jobs:
- name: Checkout Loki
uses: actions/checkout@v2

- name: Checkout Google Test
uses: actions/checkout@v2
with:
repository: google/googletest
path: 'googletest'
ref: 'dddb219c3eb96d7f9200f09b0a381f016e6b4562' # stick to a commit to avoid added future dependencies

- name: Cache Google Test
id: cache-googletest
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: googletest-install
key: ${{ runner.os }}-googletest-${{ hashFiles('**/googletest/CMakeLists.txt') }} # Unique key based on OS and CMake file

- name: Build and Install Google Test
if: steps.cache-googletest.outputs.cache-hit != 'true'
path: |
dependencies/benchmark-install
dependencies/boost
dependencies/googletest-install
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/dependencies/benchmark/CMakeLists.txt', '**/dependencies/boost/CMakeLists.txt', '**/dependencies/googletest/CMakeLists.txt') }} # Unique key based on OS and CMake files

- name: Configure, Build, and Install Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
cd googletest
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/googletest-install"
cmake --build build -j$(nproc)
cmake --install build
cmake -S dependencies -B dependencies/build
cmake --build dependencies/build -j$(nproc)
- name: Download and extract boost, no building required
- name: Configure, and Build Loki
run: |
wget --no-check-certificate 'https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz'
tar xf boost_1_84_0.tar.gz
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING:BOOL=TRUE -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/googletest-install;$GITHUB_WORKSPACE/boost_1_84_0" -S . -B build

- name: Build Loki
run: export CXXFLAGS="-Werror" && cmake --build build -j$(nproc)
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=ON -S . -B build
cmake --build build -j$(nproc)
- name: Test
working-directory: build/tests/unit
Expand Down

0 comments on commit accc8ce

Please sign in to comment.