Error running hugo when updating GitHub-hosted runner from macOS12 to macOS 14

I have been successfully using a GitHub-hosted runner to test compatibility of my theme with macOS. However, with GitHub actions now updating the latest version of the runner from macOS 12 to macOS 14, I found out my test script is no longer working properly. I’m not sure if this is an environment issue, an issue with the used Hugo binary wrapper, or an issue with Hugo itself. Perhaps someone on this forum has run into a similar issue?

I have set up a test repo on GitHub. The runner image uses npm to install the extended hugo binary (as used by the Bootstrap docs). Once the environment has been set up, a test script invokes hugo env to display the environment. Next, the same script invokes hugo mod vendor to test Hugo module compatibility.

On macOS 12, the output is the following:

> hugo env && hugo mod vendor

hugo v0.125.4-cc3574ef4f41fccbe88d9443ed066eb10867ada2+extended darwin/amd64 BuildDate=2024-04-25T13:27:26Z VendorInfo=gohugoio
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.22.2"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
hugo: downloading modules …
hugo: collected modules in 4241 ms

However, the same script fails when changing the runner to macOS 14:

> hugo env && hugo mod vendor

hugo v0.125.4-cc3574ef4f41fccbe88d9443ed066eb10867ada2+extended darwin/arm64 BuildDate=2024-04-25T13:27:26Z VendorInfo=gohugoio
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.22.2"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
Error: failed to load modules: failed to download modules: binary with name "go" not found
Error: Process completed with exit code 1.

The test results for macOS 12 and macOS 14 can be found here:

You need to install Go.

The output from hugo env shows the GOOS, GOARCH, and GOVERSION of the build.

Thanks for your reply @jmooring, I mistakenly thought the hugo env command would also check the availability of the Go binary on the host. I have now isolated the issue - it appears to be an issue with the GitHub runner images. Go should be preinstalled in these images, however, go version fails on both macos-13 and macos-14. The issue has been submitted here: #9757.

Hi, cannot find it in the READMEs as Installed Software for MaxOS > 12

macOS 12 → Installed Software → Language and Runtime

  • Kotlin 1.9.23-release-779
  • Go 1.21.9
  • Mono 6.12.0.188

macOS 13 → Installed Software → Language and Runtime

  • Kotlin 1.9.23-release-779
  • Mono 6.12.0.188

macOS 14 → Installed Software → Language and Runtime

  • Kotlin 1.9.23-release-779
  • Mono 6.12.0.188

looks like it’s just precached and you will have to use setup-go

This one works:

name: Go installation check (fail)
on:
  workflow_dispatch:

jobs:
  check:
    strategy:
      matrix:
        os:
          - macos-14
          - macos-13
          - macos-12
      
    runs-on: ${{ matrix.os }}

    steps:
      - name: Install Go
        uses: actions/setup-go@v5
        with:
          go-version: ">1.0.0"
      - name: RUN Go
        run: go version

btw - with the setup-go action even Macos 12 will useGo 1.22.2

Thanks @irkode, I overlooked the section that mentioned Cached Tools in the readme of macos-13 and macos-14. You’re right in pointing out this has changed from macos-13 onwards. I’ll include the setup step in my workflows.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.