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
This commit is contained in:
sithlord48
2024-10-22 21:56:41 -04:00
committed by Nick Bolton
parent 32b84f0a4b
commit 01565ba9a9
4 changed files with 33 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"