From 5e81667884ba2f787ff354786a8601ec1a1bf6e5 Mon Sep 17 00:00:00 2001 From: Justin Kolberg Date: Thu, 19 Dec 2024 09:00:38 -0800 Subject: [PATCH] Require yq in Makefile, install yq on Windows CI runners (#1720) * chore: require yq in Makefile Signed-off-by: Justin Kolberg * chore(ci): install yq on windows Signed-off-by: Justin Kolberg * chore(ci): install yq on windows workflow-test Signed-off-by: Justin Kolberg --------- Signed-off-by: Justin Kolberg Co-authored-by: Raj Nishtala <113392743+rnishtala-sumo@users.noreply.github.com> --- .github/workflows/workflow-build.yml | 4 ++++ .github/workflows/workflow-test.yml | 4 ++++ otelcolbuilder/Makefile | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/.github/workflows/workflow-build.yml b/.github/workflows/workflow-build.yml index b0fc3fdf0e..e0d6bc796f 100644 --- a/.github/workflows/workflow-build.yml +++ b/.github/workflows/workflow-build.yml @@ -123,6 +123,10 @@ jobs: restore-keys: | ${{ steps.get-cache-key.outputs.restore-keys }} + - name: Install yq (Windows) + if: contains(inputs.arch_os, 'windows') + run: choco install yq + - name: Set default BUILDER_BIN_PATH run: echo "BUILDER_BIN_PATH=${HOME}/bin" >> $GITHUB_ENV diff --git a/.github/workflows/workflow-test.yml b/.github/workflows/workflow-test.yml index 2e9f6c5cfe..a61514273a 100644 --- a/.github/workflows/workflow-test.yml +++ b/.github/workflows/workflow-test.yml @@ -65,6 +65,10 @@ jobs: restore-keys: | ${{ steps.get-cache-key.outputs.restore-keys }} + - name: Install yq (Windows) + if: contains(inputs.arch_os, 'windows') + run: choco install yq + - name: Set default BUILDER_BIN_PATH run: echo "BUILDER_BIN_PATH=${HOME}/bin" >> $GITHUB_ENV diff --git a/otelcolbuilder/Makefile b/otelcolbuilder/Makefile index 84fbf41af3..c7bf4a3240 100644 --- a/otelcolbuilder/Makefile +++ b/otelcolbuilder/Makefile @@ -24,6 +24,11 @@ BUILDER_BIN_PATH ?= $(HOME)/bin INSTALLED_BUILDER_VERSION := $(shell $(BUILDER_BIN_NAME) version 2>&1) +INSTALLED_YQ_VERSION := $(shell yq --version 2>&1) +ifeq ($(INSTALLED_YQ_VERSION),) + $(error "The yq command is required but was not found") +endif + # Settings for macOS builds ifeq ($(OS),darwin) AC_USERNAME ?= otel-mac-certs@sumologic.com