-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Purpose is to automate build and test of Go for various platforms using Github CI.
Usage with bash
using the tip of master branch is like:
- name: Build Go from source
uses: iwdgo/gotip-build@master
id: gotip
with:
go_variables: CGO_ENABLED=1
test_build: true
The workflows directory contain tests which can be a good start.
Compiling Go language requires a base version.
The use of generics requires Go 1.20 or later.
tip
will use Go 1.22.
Github Actions actions/setup-go@v5
can set an appropriate version.
The official reference has the details of the required configuration.
Variables can configure the build of the Go installation.
go_variables
can hold the values in the usual bash
format: CGO_ENABLED=1; GOPATH="/my-go-path"
GOROOT_BOOTSTRAP
will default to the value of go env GOROOT
.
For testing GOROOT is set to /tmp/go
.
If patches must be applied, the repository must be checked out using something like actions/checkout@v3
.
Patch files are expected in a format like produced by git format-patch master
.
Patches are applied in the sequence returned by the list function (ls
or dir
) using extension *.patch
.
If no patch file is found, the step is skipped with a relevant message.
Variable test_build
can be set to false
to skip tests. Otherwise, the run.[bash|bat]
file is launched on the current container.
Github is running natively amd64 architecture.
When cross-compiling, the native version testing is skipped.
Cross-compiled build is using Docker for a subset of architectures as feasible.
The list of tested pairs of os and architectures shows results of existing tests.
Github Action gotip-build
is available using bash
or powershell
on windows.
Versions on the master
branch are tagged but tip can be selected using the branch name master
.