Merge branch 'main' into feat-go-version-file-by-default

Resolve merge conflicts:
- action.yml: combine auto-detect description with .go-version/.tool-versions support
- versions.yml: keep auto-detect-go-mod job alongside new tool-versions/go-version jobs
- README.md: keep auto-detect section, adopt main's link to advanced-usage docs
- tests: keep auto-detect tests alongside new go-download-base-url tests
This commit is contained in:
raeperd 2026-03-25 22:27:54 +09:00
commit e9ad3144a4
96 changed files with 155671 additions and 106830 deletions

View file

@ -0,0 +1,143 @@
name: Validate Microsoft build of Go
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
microsoft-basic:
name: 'Microsoft build of Go ${{ matrix.go-version }} on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: ['1.25', '1.24']
steps:
- uses: actions/checkout@v6
- name: Setup Microsoft build of Go ${{ matrix.go-version }}
uses: ./
with:
go-version: ${{ matrix.go-version }}
go-download-base-url: 'https://aka.ms/golang/release/latest'
cache: false
- name: Verify Go installation
run: go version
- name: Verify Go env
run: go env
- name: Verify Go is functional
shell: bash
run: |
# Create a simple Go program and run it
mkdir -p /tmp/test-go && cd /tmp/test-go
cat > main.go << 'EOF'
package main
import "fmt"
func main() {
fmt.Println("Hello from Microsoft build of Go!")
}
EOF
go run main.go
microsoft-env-var:
name: 'Microsoft build of Go via env var on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
GO_DOWNLOAD_BASE_URL: 'https://aka.ms/golang/release/latest'
steps:
- uses: actions/checkout@v6
- name: Setup Microsoft build of Go via environment variable
uses: ./
with:
go-version: '1.25'
cache: false
- name: Verify Go installation
run: go version
- name: Verify Go is functional
shell: bash
run: |
mkdir -p /tmp/test-go && cd /tmp/test-go
cat > main.go << 'EOF'
package main
import "fmt"
func main() {
fmt.Println("Hello from Microsoft build of Go via env var!")
}
EOF
go run main.go
microsoft-architecture:
name: 'Microsoft build of Go arch ${{ matrix.architecture }} on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
architecture: [x64]
include:
- os: macos-latest
architecture: arm64
steps:
- uses: actions/checkout@v6
- name: Setup Microsoft build of Go with architecture
uses: ./
with:
go-version: '1.25'
go-download-base-url: 'https://aka.ms/golang/release/latest'
architecture: ${{ matrix.architecture }}
cache: false
- name: Verify Go installation
run: go version
microsoft-with-cache:
name: 'Microsoft build of Go with caching on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Setup Microsoft build of Go with caching
uses: ./
with:
go-version: '1.25'
go-download-base-url: 'https://aka.ms/golang/release/latest'
cache: true
- name: Verify Go installation
run: go version
- name: Verify Go is functional
shell: bash
run: |
mkdir -p /tmp/test-go && cd /tmp/test-go
go mod init test
cat > main.go << 'EOF'
package main
import "fmt"
func main() {
fmt.Println("Hello from cached Microsoft build of Go!")
}
EOF
go run main.go

View file

@ -14,7 +14,7 @@ jobs:
steps:
- name: Checking out
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Publish
id: publish
uses: actions/publish-immutable-action@v0.0.4

View file

@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.3.0
uses: actions/publish-action@v0.4.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View file

@ -18,9 +18,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go Stable
uses: ./
with:
@ -33,9 +33,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go oldStable
uses: ./
with:
@ -48,16 +48,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
version: [stable, oldstable]
architecture: [x64, x32]
exclude:
- os: macos-latest
architecture: x32
- os: macos-13
- os: macos-latest-large
architecture: x32
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go ${{ matrix.version }} ${{ matrix.architecture }}
uses: ./
with:
@ -72,7 +72,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest, macos-13]
os: [macos-latest, windows-latest, ubuntu-latest, macos-latest-large]
go: [1.21.13, 1.22.8, 1.23.2]
include:
- os: windows-latest
@ -82,7 +82,7 @@ jobs:
go: 1.23.2
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: setup-go ${{ matrix.go }}
uses: ./
@ -98,10 +98,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
go-version: ['1.20', '1.21', '1.22', '1.23']
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go and check latest
uses: ./
with:
@ -115,9 +115,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go and check latest
uses: ./
with:
@ -131,9 +131,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go and check latest
uses: ./
with:
@ -147,9 +147,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Create go.mod in workspace root
run: |
cat > go.mod << 'EOF'
@ -164,16 +164,48 @@ jobs:
run: __tests__/verify-go.sh 1.21
shell: bash
go-version-file-with-tool-versions:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v6
- name: Setup Go and check latest
uses: ./
with:
go-version-file: __tests__/data/.tool-versions
- name: verify go
run: __tests__/verify-go.sh 1.23.2
shell: bash
go-version-file-with-go-version:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps:
- uses: actions/checkout@v6
- name: Setup Go from .go-version file
uses: ./
with:
go-version-file: __tests__/data/.go-version
- name: verify go
run: __tests__/verify-go.sh 1.22.4
shell: bash
setup-versions-from-manifest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest, macos-13]
os: [macos-latest, windows-latest, ubuntu-latest, macos-latest-large]
go: [1.20.14, 1.21.10, 1.22.8, 1.23.2]
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: setup-go ${{ matrix.go }}
uses: ./
@ -189,11 +221,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
os: [windows-latest, ubuntu-latest, macos-latest-large]
go: [1.11.12]
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: setup-go ${{ matrix.go }}
uses: ./
@ -209,7 +241,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
go-version: [1.20.14, 1.21, 1.22, 1.23]
include:
- os: macos-latest
@ -218,10 +250,10 @@ jobs:
architecture: x64
- os: windows-latest
architecture: x64
- os: macos-13
- os: macos-latest-large
architecture: x64
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Setup Go and check latest
uses: ./
with:

View file

@ -19,7 +19,7 @@ jobs:
cache: [false, true]
go: [1.20.1]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: 'Setup ${{ matrix.cache }}, cache: ${{ matrix.go }}'
uses: ./
@ -88,7 +88,7 @@ jobs:
matrix:
cache: [false, true]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: 'Setup default go, cache: ${{ matrix.cache }}'
uses: ./
@ -121,7 +121,7 @@ jobs:
cache: [false]
go: [1.20.1]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: 'Setup ${{ matrix.go }}, cache: ${{ matrix.cache }}'
uses: ./