Skip to content

Commit

Permalink
Use Makefile operator to get GOARCH default
Browse files Browse the repository at this point in the history
* Fix bash syntax default for ENV var by using Makefile var syntax
* Modify the Collector CI test to validate the binary architecture
  • Loading branch information
NathanielRN committed Nov 25, 2021
1 parent ec6374c commit ba6fe15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/ci-collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,16 @@ jobs:
- name: Build Collector Executable for ${{ matrix.architecture }} architecture
run: GOARCH=${{ matrix.architecture }} make package
working-directory: collector
- name: Confirm architecture of built collector
working-directory: collector/build/extensions
run: |
if [ "${{ matrix.architecture }}" = "amd64" ]
then
SEARCH_STRING=x86
elif [ "${{ matrix.architecture }}" = "arm64" ]
then
SEARCH_STRING=ARM
else
exit 2
fi
grep "$SEARCH_STRING" <<< "$(file collector)"
2 changes: 1 addition & 1 deletion collector/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LAYER_NAME:=otel-collector

VERSION=$(shell cat VERSION)
GIT_SHA=$(shell git rev-parse HEAD)
GOARCH=${GOARCH-amd64}
GOARCH ?= amd64
GOBUILD=GO111MODULE=on CGO_ENABLED=0 installsuffix=cgo go build -trimpath
BUILD_INFO_IMPORT_PATH=main

Expand Down

0 comments on commit ba6fe15

Please sign in to comment.