Fix: Both unit test WFs install go conditionally
The original belief was that all repos using the basic unit test
workflow would have a go.mod file present, and that all repos with a
tag check would not. However, an exception has been found, and testing
shows that a conditional install is safe in all cases.
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I2845815ef509dfe431b71284cd186d7a93a77369
diff --git a/.github/workflows/verify-unit-tests.yaml b/.github/workflows/verify-unit-tests.yaml
index 1bab794..f684295 100644
--- a/.github/workflows/verify-unit-tests.yaml
+++ b/.github/workflows/verify-unit-tests.yaml
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 The Linux Foundation
name: Gerrit Verify - Unit Tests
-# Requires a go.mod file to be present in the repo
# yamllint disable-line rule:truthy
on:
@@ -115,6 +114,7 @@
- name: Install virtualenv
run: pip install virtualenv
- name: Install Go
+ if: ${{ hashFiles('go.mod') != '' }}
uses: actions/setup-go@v5
with:
go-version-file: go.mod