From 29b87a4e69ce2d95f08bf758d184a2a5f20acc61 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Tue, 25 Jul 2023 13:33:11 -0600 Subject: [PATCH] Modernize linux CI - Test Ubuntu-22.04 - Use ccache - Ensure backwards compatibility with Ubuntu-20.04 --- .github/workflows/continuous_integration.yml | 79 +++++++++++++++----- 1 file changed, 62 insertions(+), 17 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 4d15c8a1..a2d769f8 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -16,22 +16,22 @@ permissions: read-all jobs: linux: - runs-on: ${{matrix.os}} + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: - os: [ubuntu-20.04] compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}] cmake_build_type: [Debug, Release] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: lukka/get-cmake@latest + - uses: actions/setup-python@v4 with: python-version: '3.7' - - name: Install Ubuntu Package Dependencies - run: | - sudo apt-get -qq update - sudo apt-get install -y clang-6.0 + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}} - name: Install GoogleTest run: | # check out pre-breakage version of googletest; can be deleted when @@ -45,22 +45,67 @@ jobs: git reset --hard FETCH_HEAD cd ../.. - name: Update Glslang Sources - run: | - ./update_glslang_sources.py - - name: Build + run: ./update_glslang_sources.py + - name: Configure + run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} env: - CC: ${{matrix.compiler.cc}} - CXX: ${{matrix.compiler.cxx}} - run: | - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install .. - make -j4 install + CC: ${{matrix.compiler.cc}} + CXX: ${{matrix.compiler.cxx}} + CMAKE_GENERATOR: Ninja + CMAKE_C_COMPILER_LAUNCHER: ccache + CMAKE_CXX_COMPILER_LAUNCHER: ccache + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build --prefix build/install - name: Test run: | cd build ctest --output-on-failure && cd ../Test && ./runtests + # Ensure we can compile/run on an older distro + linux_min: + name: Linux Backcompat + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.7' + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: linux_backcompat + - name: Install GoogleTest + run: | + # check out pre-breakage version of googletest; can be deleted when + # issue 3128 is fixed + # git clone --depth=1 https://github.com/google/googletest.git External/googletest + mkdir -p External/googletest + cd External/googletest + git init + git remote add origin https://github.com/google/googletest.git + git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725 + git reset --hard FETCH_HEAD + cd ../.. + - name: Update Glslang Sources + run: ./update_glslang_sources.py + - name: Configure + run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release + env: + CMAKE_C_COMPILER_LAUNCHER: ccache + CMAKE_CXX_COMPILER_LAUNCHER: ccache + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build --prefix build/install + - name: Test + run: | + cd build + ctest --output-on-failure && + cd ../Test && ./runtests + macos: runs-on: ${{matrix.os}} strategy: