-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Makefile operator to get GOARCH default
* Fix bash syntax default for ENV var by using Makefile var syntax * Provide a PR build time test to test the different architectures
- Loading branch information
1 parent
ec6374c
commit e3531b7
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,36 @@ | ||
name: Build Collector on PR | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build-collector: | ||
runs-on: ubuntu-20.04 | ||
name: Check if we can build the collector for ${{ matrix.architecture }} | ||
strategy: | ||
matrix: | ||
architecture: [ amd64, arm64 ] | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.16' | ||
- name: Build collector | ||
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)" |
This file contains 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