Skip to content

Commit

Permalink
Sync build and CI Go versions at latest 1.16 (#34)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
sodabrew and jpkrohling authored May 11, 2021
1 parent fe3af5d commit 4f061ca
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

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

go 1.14
go 1.16

require (
github.com/go-logr/logr v0.2.1
Expand Down
147 changes: 0 additions & 147 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/scaffold/gomod.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package scaffold
const Gomod = `
module {{.Distribution.Module}}
go 1.15
go 1.16
require (
{{- range .Extensions}}
Expand Down
14 changes: 13 additions & 1 deletion test/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/bin/bash

GOBIN=$(go env GOBIN)
if [[ "$GO" == "" ]]; then
GOBIN=$(which go)
fi

if [[ "$GOBIN" == "" ]]; then
echo "Could not determine which Go binary to use."
exit 1
fi

echo "Using ${GOBIN} to compile the distributions."

# each attempt pauses for 100ms before retrying
max_retries=50

Expand All @@ -20,7 +32,7 @@ do

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

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

0 comments on commit 4f061ca

Please sign in to comment.