Modernize linux CI

- Test Ubuntu-22.04
- Use ccache
- Ensure backwards compatibility with Ubuntu-20.04
This commit is contained in:
Juan Ramos 2023-07-25 13:33:11 -06:00 committed by arcady-lunarg
parent 4aa56496d6
commit 29b87a4e69

View File

@ -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,16 +45,61 @@ 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}}
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: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
make -j4 install
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