actions / runner-images

GitHub Actions runner images
MIT License
9.17k stars 2.84k forks source link

Go binary cannot be found on macOS 13 and macOS 14 runner images #9757

Closed markdumay closed 2 weeks ago

markdumay commented 2 weeks ago

Description

With the recent switch from macos-12 to macos-14 when using the macos-latest tag, it appears the Go binary cannot longer be found. The macos-13 image also appears to be affected. The docs (e.g. macos-13, macos-14-arm64) still suggest multiple versions of Go should be preinstalled.

NB: the code has not been tested with the macOS large runners due to account / billing limitations.

Platforms affected

Runner images affected

Image version and build link

2.316.0, see https://github.com/markdumay/gha-hugo-macos/actions/runs/8865382577

Is it regression?

No

Expected behavior

Running go version from within the workflow should return a valid Go version, e.g. go version go1.21.9 darwin/amd64.

Actual behavior

On macos-13 and macos-14, running go version returns an error:

/Users/runner/work/_temp/xxx-xxx-xxx-xxx-xxx.sh: line 1: go: command not found
Error: Process completed with exit code 127.

Repro steps

  1. Create a new workflow file in any repository, e.g. .github/workflows/fail.yml and copy the following code:
name: Go installation check (fail)
on:
  workflow_dispatch:

jobs:
  check:
    strategy:
      matrix:
        os:
          - macos-14
          - macos-13

    runs-on: ${{ matrix.os }}

    steps:
    - run: go version
  1. Manually run the workflow Go installation check (fail) in the actions overview.
irkode commented 2 weeks ago

not listed in the 13 and 14 readmes as "installed"

using setup-go will succeed and report 1.22.2 for all versions

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
markdumay commented 2 weeks ago

Thanks @irkode, you're right. After some more careful reading, the Go binary is indeed only available as precached tool in both runner images. I'll close this issue as solved.