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: jobs:
linux: linux:
runs-on: ${{matrix.os}} runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-20.04]
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}] compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release] cmake_build_type: [Debug, Release]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: lukka/get-cmake@latest
- uses: actions/setup-python@v4
with: with:
python-version: '3.7' python-version: '3.7'
- name: Install Ubuntu Package Dependencies - name: Setup ccache
run: | uses: hendrikmuhs/ccache-action@v1.2
sudo apt-get -qq update with:
sudo apt-get install -y clang-6.0 key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
- name: Install GoogleTest - name: Install GoogleTest
run: | run: |
# check out pre-breakage version of googletest; can be deleted when # check out pre-breakage version of googletest; can be deleted when
@ -45,22 +45,67 @@ jobs:
git reset --hard FETCH_HEAD git reset --hard FETCH_HEAD
cd ../.. cd ../..
- name: Update Glslang Sources - name: Update Glslang Sources
run: | run: ./update_glslang_sources.py
./update_glslang_sources.py - name: Configure
- name: Build run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
env: env:
CC: ${{matrix.compiler.cc}} CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}} CXX: ${{matrix.compiler.cxx}}
run: | CMAKE_GENERATOR: Ninja
mkdir build && cd build CMAKE_C_COMPILER_LAUNCHER: ccache
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install .. CMAKE_CXX_COMPILER_LAUNCHER: ccache
make -j4 install - name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test - name: Test
run: | run: |
cd build cd build
ctest --output-on-failure && ctest --output-on-failure &&
cd ../Test && ./runtests 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: macos:
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
strategy: strategy: