Move gcc 4.8 tests to docker image (#292)

Co-authored-by: Dominik Thalhammer <thalhammer.d@googlemail.com>
This commit is contained in:
Chris Mc
2023-05-26 12:40:20 -07:00
committed by GitHub
parent 4e3dd40cfe
commit ad08c684a2
3 changed files with 57 additions and 27 deletions

View File

@@ -0,0 +1,39 @@
name: Install CMake
description: Download, Build and Cache CMake
inputs:
version:
description: The desired CMake version to install
required: true
url:
description: "The corresponding URL to download the source code from"
required: true
runs:
using: composite
steps:
- name: Cache CMake
id: cache-cmake
uses: actions/cache@v3
with:
path: cmake-${{ inputs.version }}
key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-cmake-${{ inputs.version }}
- name: Build cmake
if: steps.cache-cmake.outputs.cache-hit != 'true'
run: |
wget ${{ inputs.url }}
tar -zxf cmake-${{ inputs.version }}.tar.gz
cd cmake-${{ inputs.version }}
./bootstrap
make -j $(nproc)
shell: bash
- name: Install cmake
run: |
cd cmake-${{ inputs.version }}
# Depending if we run in on a GitHub Actions or from within a Docker image we have different permissions
if [[ $EUID > 0 ]]; then
# If we are not root then we need to sudo
sudo make install
else
# Default docker image does not have users setup so we are only root and can not sudo
make install
fi
shell: bash

View File

@@ -74,31 +74,12 @@ jobs:
min-req:
runs-on: ubuntu-20.04
env:
RUN_ON: ubuntu-20.04
CMAKE_URL: https://cmake.org/files/v3.14/cmake-3.14.7.tar.gz
CMAKE_VERSION: 3.14.7
steps:
- uses: actions/checkout@v3
- name: Cache CMake
id: cache-cmake
uses: actions/cache@v3
- uses: ./.github/actions/install/cmake
with:
path: cmake-${{ env.CMAKE_VERSION }}
key: ubuntu-20.04-${{ github.job }}-cmake-${{ env.CMAKE_VERSION }}
- name: Build cmake
if: steps.cache-cmake.outputs.cache-hit != 'true'
run: |
wget ${{ env.CMAKE_URL }}
tar -zxf cmake-${{ env.CMAKE_VERSION }}.tar.gz
cd cmake-${{ env.CMAKE_VERSION }}
./bootstrap
make -j $(nproc)
- name: Install cmake
run: |
cd cmake-${{ env.CMAKE_VERSION }}
sudo make install
version: "3.14.7"
url: "https://cmake.org/files/v3.14/cmake-3.14.7.tar.gz"
- uses: ./.github/actions/install/gtest
- name: setup

View File

@@ -16,18 +16,28 @@ on:
jobs:
gcc-4-8:
name: GCC 4.8
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container:
image: ubuntu:18.04
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
steps:
- run: sudo apt-get install g++-4.8
- uses: lukka/get-cmake@latest
- run: |
apt-get update
apt-get install -y g++-4.8 wget make libssl-dev
- uses: actions/checkout@v3
- uses: ./.github/actions/install/cmake
with:
version: "3.26.3"
url: "https://cmake.org/files/v3.26/cmake-3.26.3.tar.gz"
- name: setup
run: |
mkdir build
cd build
CC=gcc-4.8 CXX=g++-4.8 cmake ..
sudo cmake --install .
cmake ..
cmake --install .
- name: test
working-directory: tests/cmake
run: |