From b05c8e08b4dde2477a5f252a454452461ceb2662 Mon Sep 17 00:00:00 2001 From: Marcelo Zimbres Date: Sat, 28 Oct 2023 13:38:41 +0200 Subject: [PATCH] Adds container to matrix. --- .github/workflows/ci.yml | 81 +++++++++++++++++++++++---- test/cmake_subdir_test/CMakeLists.txt | 5 +- tools/ci.py | 2 +- 3 files changed, 72 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5f5bce6..5ed78330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,15 +131,51 @@ jobs: fail-fast: false matrix: include: - - { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' } - - { toolset: gcc-11, install: g++-11, os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', ldflags: '' } - - { toolset: clang-11, install: clang-11, os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', ldflags: '' } - - { toolset: clang-11, install: clang-11, os: ubuntu-22.04, cxxstd: '20', build-type: 'Debug', ldflags: '' } - - { toolset: clang-13, install: clang-13, os: ubuntu-22.04, cxxstd: '17', build-type: 'Release', ldflags: '' } - - { toolset: clang-13, install: clang-13, os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', ldflags: '' } + - toolset: gcc-11 + install: g++-11 + os: ubuntu-latest + container: ubuntu:22.04 + cxxstd: '17' + build-type: 'Debug' + ldflags: '' + - toolset: gcc-11 + install: g++-11 + os: ubuntu-22.04 + cxxstd: '20' + build-type: 'Release' + ldflags: '' + - toolset: clang-11 + install: clang-11 + os: ubuntu-latest + container: ubuntu:22.04 + cxxstd: '17' + build-type: 'Debug' + ldflags: '' + - toolset: clang-11 + install: clang-11 + os: ubuntu-latest + container: ubuntu:22.04 + cxxstd: '20' + build-type: 'Debug' + ldflags: '' + - toolset: clang-13 + install: clang-13 + os: ubuntu-latest + container: ubuntu:22.04 + cxxstd: '17' + build-type: 'Release' + ldflags: '' + - toolset: clang-13 + install: clang-13 + os: ubuntu-latest + container: ubuntu:22.04 + cxxstd: '20' + build-type: 'Release' + ldflags: '' - { toolset: clang-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxstd: '17', build-type: 'Debug', cxxflags: '-stdlib=libc++', ldflags: '-lc++' } - { toolset: clang-14, install: 'clang-14 libc++-14-dev libc++abi-14-dev', os: ubuntu-22.04, cxxstd: '20', build-type: 'Release', cxxflags: '-stdlib=libc++', ldflags: '-lc++' } runs-on: ${{ matrix.os }} + container: ${{matrix.container}} env: CXXFLAGS: ${{matrix.cxxflags}} -Wall -Wextra LDFLAGS: ${{matrix.ldflags}} @@ -148,8 +184,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Setup container environment + if: matrix.container + run: | + apt-get update + apt-get -y install sudo python3 git g++ libssl-dev protobuf-compiler redis-server + - name: Install dependencies - run: sudo apt-get -y install cmake protobuf-compiler redis-server python3 ${{ matrix.install }} + run: | + sudo apt-get update + sudo apt-get -y install cmake protobuf-compiler redis-server python3 ${{ matrix.install }} - name: Setup Boost run: ./tools/ci.py setup-boost --source-dir=$(pwd) @@ -209,15 +253,30 @@ jobs: fail-fast: false matrix: include: - - { toolset: gcc-11, install: g++-11, cxxstd: "11,17,20" } # Having C++11 shouldn't break the build - - { toolset: clang-14, install: clang-14, cxxstd: "17,20" } - runs-on: ubuntu-22.04 + - toolset: gcc-11 + install: g++-11 + cxxstd: "11,17,20" # Having C++11 shouldn't break the build + - toolset: clang-14 + install: clang-14 + os: ubuntu-latest + container: ubuntu:22.04 + cxxstd: "17,20" + runs-on: ${{ matrix.os }} + container: ${{matrix.container}} steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup container environment + if: matrix.container + run: | + apt-get update + apt-get -y install sudo python3 git g++ libssl-dev + - name: Install dependencies - run: sudo apt-get -y install python3 ${{ matrix.install }} + run: | + sudo apt-get update + sudo apt-get -y install python3 ${{ matrix.install }} - name: Setup Boost run: ./tools/ci.py setup-boost --source-dir=$(pwd) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index 5f3339b8..b5cdbe9b 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -5,10 +5,7 @@ project(cmake_subdir_test LANGUAGES CXX) set(BOOST_INCLUDE_LIBRARIES redis) # Build our dependencies, so the targets Boost::xxx are defined -add_subdirectory(${_BOOST_ROOT} boostorg/boost) - -# Build our project -add_subdirectory(${_BOOST_ROOT}/libs/redis boostorg/redis) +add_subdirectory(${_BOOST_ROOT} ../../../..) add_executable(main main.cpp) target_link_libraries(main PRIVATE Boost::redis) diff --git a/tools/ci.py b/tools/ci.py index e566987f..ff7d5ff1 100755 --- a/tools/ci.py +++ b/tools/ci.py @@ -115,7 +115,7 @@ def _setup_boost( # Install Boost dependencies _run(["git", "config", "submodule.fetchJobs", "8"]) _run(["git", "submodule", "update", "-q", "--init", "tools/boostdep"]) - _run(["python", "tools/boostdep/depinst/depinst.py", "--include", "example", "redis"]) + _run(["python3", "tools/boostdep/depinst/depinst.py", "--include", "example", "redis"]) # Bootstrap if _is_windows: