Skip to content

Commit

Permalink
update tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Jan 5, 2024
1 parent 416e25d commit 6fc961b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 40 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Performance regression check
runs-on: ubuntu-latest
env:
BENCHMARK_INSTALL_DIR: ${{ github.workspace }}/benchmark-install
BENCHMARK_INSTALL_DIR: $GITHUB_WORKSPACE/benchmark-install
steps:
- name: Checkout Loki
uses: actions/checkout@v2
Expand All @@ -28,6 +28,7 @@ jobs:
with:
repository: google/benchmark
path: 'benchmark'
ref: '4575fc415f17c45911f7df7aacbf83a378c5565a' # they plan to add a dependency to abseil soon that we want to avoid

- name: Build and Install Google Benchmark
run: |
Expand All @@ -41,23 +42,9 @@ jobs:
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
pwd
- name: Check boost
id: check-boost
run: |
pwd
echo "${{runner.workspace}}"
echo $GITHUB_WORKSPACE
echo $BENCHMARK_INSTALL_DIR
echo $GITHUB_WORKSPACE/boost_1_84_0
ls -l
cd boost_1_84_0
ls -l
- name: Configure CMake
run: |
pwd
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARKING:BOOL=TRUE -DCMAKE_PREFIX_PATH="$BENCHMARK_INSTALL_DIR;$GITHUB_WORKSPACE/boost_1_84_0" -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build Loki
Expand Down
60 changes: 35 additions & 25 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,40 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
shell: bash
env:
GTEST_INSTALL_DIR: $GITHUB_WORKSPACE/googletest-install

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

- name: Download boost
id: install-boost
run: |
bash .github/workflows/scripts/install_boost.sh
echo "BOOST_ROOT=${{runner.workspace}}/Loki/boost_1_84_0" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: cmake -DENABLE_TESTING:BOOL=TRUE -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build
working-directory: ${{runner.workspace}}/build
run: export CXXFLAGS="-Werror" && cmake --build .

- name: Test
working-directory: ${{runner.workspace}}/build/tests
run: GTEST_OUTPUT=xml:test-results/ GTEST_COLOR=1 ctest -V
- 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: Build and Install Google Test
run: |
cd benchmark
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_INSTALL_PREFIX=${BENCHMARK_INSTALL_DIR}
cmake --build build
cmake --install build
- name: Download and extract boost
id: install-boost
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="$GTEST_INSTALL_DIR;$GITHUB_WORKSPACE/boost_1_84_0" -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build Loki
run: export CXXFLAGS="-Werror" && cmake --build build

- name: Test
working-directory: $GITHUB_WORKSPACE/build/tests
run: GTEST_OUTPUT=xml:test-results/ GTEST_COLOR=1 ctest -V

0 comments on commit 6fc961b

Please sign in to comment.