Skip to content

Commit 263b8e4

Browse files
Merge branch 'actions:main' into main
2 parents 6e95d33 + 4a36011 commit 263b8e4

17 files changed

Lines changed: 56874 additions & 688 deletions
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Validate Microsoft build of Go
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
microsoft-basic:
15+
name: 'Microsoft build of Go ${{ matrix.go-version }} on ${{ matrix.os }}'
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, windows-latest, macos-latest]
21+
go-version: ['1.25', '1.24']
22+
steps:
23+
- uses: actions/checkout@v6
24+
25+
- name: Setup Microsoft build of Go ${{ matrix.go-version }}
26+
uses: ./
27+
with:
28+
go-version: ${{ matrix.go-version }}
29+
go-download-base-url: 'https://aka.ms/golang/release/latest'
30+
cache: false
31+
32+
- name: Verify Go installation
33+
run: go version
34+
35+
- name: Verify Go env
36+
run: go env
37+
38+
- name: Verify Go is functional
39+
shell: bash
40+
run: |
41+
# Create a simple Go program and run it
42+
mkdir -p /tmp/test-go && cd /tmp/test-go
43+
cat > main.go << 'EOF'
44+
package main
45+
import "fmt"
46+
func main() {
47+
fmt.Println("Hello from Microsoft build of Go!")
48+
}
49+
EOF
50+
go run main.go
51+
52+
microsoft-env-var:
53+
name: 'Microsoft build of Go via env var on ${{ matrix.os }}'
54+
runs-on: ${{ matrix.os }}
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
os: [ubuntu-latest, windows-latest, macos-latest]
59+
env:
60+
GO_DOWNLOAD_BASE_URL: 'https://aka.ms/golang/release/latest'
61+
steps:
62+
- uses: actions/checkout@v6
63+
64+
- name: Setup Microsoft build of Go via environment variable
65+
uses: ./
66+
with:
67+
go-version: '1.25'
68+
cache: false
69+
70+
- name: Verify Go installation
71+
run: go version
72+
73+
- name: Verify Go is functional
74+
shell: bash
75+
run: |
76+
mkdir -p /tmp/test-go && cd /tmp/test-go
77+
cat > main.go << 'EOF'
78+
package main
79+
import "fmt"
80+
func main() {
81+
fmt.Println("Hello from Microsoft build of Go via env var!")
82+
}
83+
EOF
84+
go run main.go
85+
86+
microsoft-architecture:
87+
name: 'Microsoft build of Go arch ${{ matrix.architecture }} on ${{ matrix.os }}'
88+
runs-on: ${{ matrix.os }}
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
os: [ubuntu-latest, macos-latest]
93+
architecture: [x64]
94+
include:
95+
- os: macos-latest
96+
architecture: arm64
97+
steps:
98+
- uses: actions/checkout@v6
99+
100+
- name: Setup Microsoft build of Go with architecture
101+
uses: ./
102+
with:
103+
go-version: '1.25'
104+
go-download-base-url: 'https://aka.ms/golang/release/latest'
105+
architecture: ${{ matrix.architecture }}
106+
cache: false
107+
108+
- name: Verify Go installation
109+
run: go version
110+
111+
microsoft-with-cache:
112+
name: 'Microsoft build of Go with caching on ${{ matrix.os }}'
113+
runs-on: ${{ matrix.os }}
114+
strategy:
115+
fail-fast: false
116+
matrix:
117+
os: [ubuntu-latest, windows-latest, macos-latest]
118+
steps:
119+
- uses: actions/checkout@v6
120+
121+
- name: Setup Microsoft build of Go with caching
122+
uses: ./
123+
with:
124+
go-version: '1.25'
125+
go-download-base-url: 'https://aka.ms/golang/release/latest'
126+
cache: true
127+
128+
- name: Verify Go installation
129+
run: go version
130+
131+
- name: Verify Go is functional
132+
shell: bash
133+
run: |
134+
mkdir -p /tmp/test-go && cd /tmp/test-go
135+
go mod init test
136+
cat > main.go << 'EOF'
137+
package main
138+
import "fmt"
139+
func main() {
140+
fmt.Println("Hello from cached Microsoft build of Go!")
141+
}
142+
EOF
143+
go run main.go

.licensed.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ allowed:
1212
- 0bsd
1313

1414
reviewed:
15-
npm:
15+
npm:
16+
- "@actions/http-client"

.licenses/npm/@actions/http-client-3.0.0.dep.yml renamed to .licenses/npm/@actions/http-client-3.0.2.dep.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/fast-xml-builder.dep.yml

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/fast-xml-parser.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/minimatch.dep.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.licenses/npm/undici-6.23.0.dep.yml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ See [action.yml](action.yml).
5454

5555
# Architecture to install (auto-detected if not specified)
5656
architecture: 'x64'
57+
58+
# Custom base URL for Go downloads (e.g., for mirrors)
59+
go-download-base-url: ''
5760
```
5861
<!-- end usage -->
5962
@@ -130,6 +133,7 @@ For examples of using `cache-dependency-path`, see the [Caching](docs/advanced-u
130133
- [Check latest version](docs/advanced-usage.md#check-latest-version)
131134
- [Caching](docs/advanced-usage.md#caching)
132135
- [Outputs](docs/advanced-usage.md#outputs)
136+
- [Custom download URL](docs/advanced-usage.md#custom-download-url)
133137
- [Using `setup-go` on GHES](docs/advanced-usage.md#using-setup-go-on-ghes)
134138

135139
## License

0 commit comments

Comments
 (0)