name: On Linux on: push: branches: [ develop, master ] pull_request: branches: [ develop, master ] jobs: build: name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: config: - name: "Ubuntu 18.04 with Clang 3.9" cxx_ver: 11 compiler: clang compiler_ver: 3.9 - name: "Ubuntu 18.04 with GCC 5.0" cxx_ver: 11 compiler: gcc compiler_ver: 5 - name: "Ubuntu 18.04 with GCC 11.0" cxx_ver: 17 compiler: gcc compiler_ver: 11 - name: "Ubuntu 18.04 with Clang 13" cxx_ver: 17 compiler: clang compiler_ver: 13 steps: - name: Prepare specific Clang version if: ${{ matrix.config.compiler == 'clang' }} run: | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-13 main" sudo apt update sudo apt install clang-${{ matrix.config.compiler_ver}} sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{ matrix.config.compiler_ver}} 100 sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{ matrix.config.compiler_ver}} 100 - name: Prepare specific GCC version if: ${{ matrix.config.compiler == 'gcc' }} run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install g++-${{ matrix.config.compiler_ver}} sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${{ matrix.config.compiler_ver}} 100 sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${{ matrix.config.compiler_ver}} 100 - name: Installing GTest run: | sudo add-apt-repository ppa:team-xbmc/ppa sudo apt-get update sudo apt-get install libgmock-dev - uses: actions/checkout@v3 - name: Configure run: cmake -S . -B build -DBITSERY_BUILD_TESTS=ON -DBITSERY_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=${{ matrix.config.cxx_ver }} - name: Build run: cmake --build build - name: Run tests run: ctest --test-dir build