-
Notifications
You must be signed in to change notification settings - Fork 672
feat: add go-download-base-url input for custom Go distributions #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,055
−110
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
78af96c
feat: add go-download-base-url input for custom Go distributions
gdams 107f2fc
run prettier
gdams 6d261de
fixup PR review
gdams e937024
revert cache-save
gdams 3efc8fd
fixup
gdams fa4cd76
handle distinct cache
gdams 9142921
skip json for known URL
gdams 0980fb1
fix bug in JSON with custom URL
gdams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.