Skip to content

Commit

Permalink
Merge pull request #65 from milosz-barylowicz/devops-specifying-cmake…
Browse files Browse the repository at this point in the history
…-version

[DevOps]: CMake package upgraded to 3.28.3, GitHub Actions pipelines aligned to new requirements
  • Loading branch information
milosz-barylowicz committed Mar 1, 2024
2 parents 1b68953 + a89cc2b commit 3f070d8
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 8 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_and_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
python3.12 -m venv venv && \
source venv/bin/activate
- name: CMake-package-update
run: |
sudo apt purge --auto-remove cmake && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \
sudo apt update && \
sudo apt install cmake
- name: CMake-configuration-and-project-building
run: |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} && \
Expand Down Expand Up @@ -64,6 +72,14 @@ jobs:
python3.12 -m venv venv && \
source venv/bin/activate
- name: CMake-package-update
run: |
sudo apt purge --auto-remove cmake && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \
sudo apt update && \
sudo apt install cmake
- name: asan-execution
run: |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DASan=ON && \
Expand Down Expand Up @@ -106,6 +122,14 @@ jobs:
python3.12 -m venv venv && \
source venv/bin/activate
- name: CMake-package-update
run: |
sudo apt purge --auto-remove cmake && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \
sudo apt update && \
sudo apt install cmake
- name: valgrind-setting-up
run: |
sudo apt update --fix-missing && sudo apt install valgrind
Expand Down Expand Up @@ -174,6 +198,14 @@ jobs:
python3.12 -m venv venv && \
source venv/bin/activate
- name: CMake-package-update
run: |
sudo apt purge --auto-remove cmake && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main' && \
sudo apt update && \
sudo apt install cmake
- name: project-building
run: |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} -DCOVERAGE=ON && \
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1

- name: CMake-package-update
run: |
choco install cmake
- name: project-building
run: |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} &&
Expand All @@ -44,6 +48,10 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1

- name: CMake-package-update
run: |
brew upgrade cmake
- name: building
run: |
cmake -B ${{ env.BUILD_DIR }} -S ${{ github.workspace }} && \
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.22)
cmake_minimum_required(VERSION 3.28.3)

set(CMAKE_CXX_STANDARD 20)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt-get install build-essential software-properties-common -y && \
RUN mkdir -p /.cmake && chmod 777 /.cmake

# Install CMake
RUN curl -sSL https://cmake.org/files/v3.24/cmake-3.24.4-linux-x86_64.tar.gz | tar --strip-component=1 -xzC /usr/local
RUN curl -sSL https://cmake.org/files/v3.29/cmake-3.29.0-rc2-linux-x86_64.tar.gz | tar --strip-component=1 -xzC /usr/local

# Creating build directory to avoid CMake Error: Unable to (re)create the private pkgRedirects directory
RUN mkdir -p /workspace/build && chmod 777 /workspace/build
Expand Down
5 changes: 4 additions & 1 deletion scripts/docker/compile_and_execute_unit_tests.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/python3

import os
import subprocess

current_working_dir = "workspace"

subprocess.run(['cmake', '-S', current_working_dir + "/containers", '-B', current_working_dir + "/build"])
subprocess.run(['cmake', '--build', current_working_dir + '/build'])
subprocess.run(['python3', current_working_dir + '/build/tests/run_unit_tests.py'])

os.chdir(current_working_dir + '/build/tests/')
subprocess.run(['python3', 'run_unit_tests.py'])
5 changes: 0 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ FetchContent_Declare(googletest
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${GTEST_ROOT}
)

# FetchContent_Declare(googletest
# URL https://github.com/google/googletest/archive/refs/tags/${GTEST_VERSION}.tar.gz
# URL_HASH MD5=c8340a482851ef6a3fe618a082304cfc
# )

option(INSTALL_GTEST OFF)
FetchContent_MakeAvailable(googletest)

Expand Down

0 comments on commit 3f070d8

Please sign in to comment.