Skip to content

Commit 4f061ca

Browse files
sodabrewjpkrohling
andauthored
Sync build and CI Go versions at latest 1.16 (#34)
* Sync build and CI Go versions at latest 1.16 * Run go mod tidy * Set go binary to use in the compilation phase in tests Signed-off-by: Juraci Paixão Kröhling <[email protected]> Co-authored-by: Juraci Paixão Kröhling <[email protected]>
1 parent fe3af5d commit 4f061ca

File tree

7 files changed

+19
-154
lines changed

7 files changed

+19
-154
lines changed

.github/workflows/go.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v2
1717
with:
18-
go-version: 1.15
18+
go-version: 1.16
1919

2020
- name: Check out code into the Go module directory
2121
uses: actions/checkout@v2

.github/workflows/integration-test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v2
1717
with:
18-
go-version: 1.15
18+
go-version: 1.16
1919

2020
- name: Check out code into the Go module directory
2121
uses: actions/checkout@v2

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
name: Set up Go
1919
uses: actions/setup-go@v2
2020
with:
21-
go-version: 1.15
21+
go-version: 1.16
2222
-
2323
name: Run GoReleaser
2424
uses: goreleaser/goreleaser-action@v2
2525
with:
2626
version: latest
2727
args: release --rm-dist
2828
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
module github.com/open-telemetry/opentelemetry-collector-builder
1616

17-
go 1.14
17+
go 1.16
1818

1919
require (
2020
github.com/go-logr/logr v0.2.1

go.sum

-147
Large diffs are not rendered by default.

internal/scaffold/gomod.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package scaffold
1717
const Gomod = `
1818
module {{.Distribution.Module}}
1919
20-
go 1.15
20+
go 1.16
2121
2222
require (
2323
{{- range .Extensions}}

test/test.sh

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/bin/bash
22

3+
GOBIN=$(go env GOBIN)
4+
if [[ "$GO" == "" ]]; then
5+
GOBIN=$(which go)
6+
fi
7+
8+
if [[ "$GOBIN" == "" ]]; then
9+
echo "Could not determine which Go binary to use."
10+
exit 1
11+
fi
12+
13+
echo "Using ${GOBIN} to compile the distributions."
14+
315
# each attempt pauses for 100ms before retrying
416
max_retries=50
517

@@ -20,7 +32,7 @@ do
2032

2133
echo "Starting test '${test}' at `date`" >> "${out}/test.log"
2234

23-
go run . --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1
35+
go run . --go "${GOBIN}" --config "./test/${test}.builder.yaml" --output-path "${out}" --name otelcol-built-test > "${out}/builder.log" 2>&1
2436
if [ $? != 0 ]; then
2537
echo "❌ FAIL ${test}. Failed to compile the test ${test}. Build logs:"
2638
cat "${out}/builder.log"

0 commit comments

Comments
 (0)