Skip to content

GOPATH set mulit dir error in windows #699

@eudore

Description

@eudore

Description:
The GOPATH setting encounters a multi-directory error in the Windows os, but it functions normally on macOS and Ubuntu.

Action version:
v5 v6

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
go1.22 go.1.24

Repro steps:

action link: https://github.com/eudore/action-demo/actions/runs/20198912797/job/57986928672

name: Run Tests
on:
  push:
    branches: ["master"]
permissions:
  contents: read
jobs:
  test:
    strategy:
      max-parallel: 16
      matrix:
        os: [macos, ubuntu, windows]
        go: ["1.20", "1.22", "1.24"]
        include:
          - os: macos
            gopath: /Users/runner/go
            gocache: /Users/runner/Library/Caches/go-build
          - os: ubuntu
            gopath: /home/runner/go
            gocache: /home/runner/.cache/go-build
          - os: windows
            gopath: C:\Users\runneradmin\go
            gocache: C:\Users\runneradmin\AppData\Local\go-build
    name: ${{ matrix.os }} @ Go ${{ matrix.go }}
    runs-on: ${{ matrix.os }}-latest
    env:
      GO111MODULE: ${{ matrix.go < '1.22' && 'off' || 'on' }}
      GOPATH: ${{ matrix.gopath }}${{ matrix.os == 'windows' && ';' || ':' }}${{ github.workspace }}
      GOARCH: amd64
      CGO_ENABLED: 1
      WORKDIR: src/github.com/eudore/eudore/
      PACKAGES: github.com/eudore/eudore,github.com/eudore/eudore/middleware
    defaults:
      run:
        working-directory: ${{ env.WORKDIR }}
    steps:
      - uses: actions/checkout@v4
        with:
          path: ${{ env.WORKDIR }}
      - uses: actions/setup-go@v6
        with:
          go-version: ${{ matrix.go }}
          cache: false

Expected behavior:

ubuntu:

Run actions/setup-go@v6
  with:
    go-version: 1.24
    cache: false
    check-latest: false
    token: ***
  env:
    GO111MODULE: on
    GOPATH: /home/runner/go:/home/runner/work/action-demo/action-demo
    GOARCH: amd64
    CGO_ENABLED: 1
    WORKDIR: src/github.com/eudore/eudore/
    PACKAGES: github.com/eudore/eudore,github.com/eudore/eudore/middleware
Setup go version spec 1.24
Found in cache @ /opt/hostedtoolcache/go/1.24.11/x64
Added go to the path
Successfully set up Go version 1.24
go version go1.24.11 linux/amd64

Actual behavior:

windows:

Run actions/setup-go@v6
  with:
    go-version: 1.24
    cache: false
    check-latest: false
    token: ***
  env:
    GO111MODULE: on
    GOPATH: C:\Users\runneradmin\go;D:\a\action-demo\action-demo
    GOARCH: amd64
    CGO_ENABLED: 1
    WORKDIR: src/github.com/eudore/eudore/
    PACKAGES: github.com/eudore/eudore,github.com/eudore/eudore/middleware
Setup go version spec 1.24
Found in cache @ C:\hostedtoolcache\windows\go\1.24.11\x64
Added go to the path
Successfully set up Go version 1.24
Error: ENOENT: no such file or directory, mkdir 'C:\Users\runneradmin\go;D:\a\action-demo\action-demo'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions