From 01565ba9a97c2674d3df7c5b0c6280438770d231 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Tue, 22 Oct 2024 21:56:41 -0400 Subject: [PATCH] ci: make sure git is installed before calling fancy-checkout When we want to use the base runners they do not have git Install devscripts for debian images that will make packages --- .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/codeql-analysis.yml | 5 +++++ .github/workflows/sonarcloud-analysis.yml | 13 ++++++------- .github/workflows/valgrind-analysis.yml | 11 +++++------ 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da596ab81..c265bc022 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,6 +163,23 @@ jobs: config-args: "-G Ninja -DCMAKE_INSTALL_PREFIX=/usr" steps: + # Make sure the container has git before we do anything else + - name: Install Git on Container + if: ${{ matrix.target.container }} + shell: bash + run : | + if [ "${{matrix.target.like}}" == "debian" ]; then + apt update -qqq > /dev/null && apt install -qqq git devscripts > /dev/null + elif [ "${{matrix.target.like}}" == "fedora" ]; then + dnf install -y git + elif [ "${{matrix.target.like}}" == "suse" ]; then + zypper refresh + zypper install -y --force-resolution git + elif [ "${{matrix.target.like}}" == "arch" ]; then + pacman -Syu --noconfirm git + else + echo "Unknown: ${{matrix.target.like}}" + fi # Fancy checkout gets all the tags # it also makes sure we can use git --describe correctly - name: Fancy Checkout diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 48e29fe0b..50651e3d5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,6 +38,11 @@ jobs: language: ["cpp"] steps: + - name: Install container dependencies + run: | + apt update -qqq > /dev/null + apt install -qqq git > /dev/null + - name: Fancy Checkout uses: sithlord48/fancy-checkout@v1.0.0 diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index 37e36ae07..865bfc235 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -22,20 +22,19 @@ jobs: CPU_CORE_COUNT: ${{ vars.SONAR_SCANNER_CPU_COUNT || 4 }} steps: + - name: Install container dependencies + run: | + apt update -qqq > /dev/null + apt install -qqq git curl unzip gcovr > /dev/null + - name: Fancy Checkout uses: sithlord48/fancy-checkout@v1.0.0 - - name: Install dependencies + - name: Install project dependencies uses: ./.github/actions/install-dependencies with: like: "debian" - - name: Install dependencies (extra) - run: apt install curl unzip gcovr -y - env: - # Prevent apt prompting for input. - DEBIAN_FRONTEND: noninteractive - - name: Install sonar-scanner and build-wrapper uses: sonarsource/sonarcloud-github-c-cpp@v3 diff --git a/.github/workflows/valgrind-analysis.yml b/.github/workflows/valgrind-analysis.yml index ab1ce1895..eaead5939 100644 --- a/.github/workflows/valgrind-analysis.yml +++ b/.github/workflows/valgrind-analysis.yml @@ -11,6 +11,11 @@ jobs: timeout-minutes: 10 steps: + - name: Install container dependencies + run: | + apt update -qqq > /dev/null + apt install -qqq git valgrind > /dev/null + - name: Fancy Checkout uses: sithlord48/fancy-checkout@v1.0.0 @@ -19,12 +24,6 @@ jobs: with: like: "debian" - - name: Install valgrind - run: apt install valgrind -y - env: - # Prevent apt prompting for input. - DEBIAN_FRONTEND: noninteractive - - name: Configure run: cmake -B build -G "Ninja"