From a0a0460a60f90eefcb7c1ffb4d4c8a2edc10d4f9 Mon Sep 17 00:00:00 2001 From: "(Eliseo) Nathaniel Ruiz Nowell" Date: Thu, 2 Dec 2021 11:28:03 -0800 Subject: [PATCH] Use CI for logic branching instead of bash (#187) --- .github/workflows/ci-collector.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-collector.yml b/.github/workflows/ci-collector.yml index 8bd756ee21..0d07378863 100644 --- a/.github/workflows/ci-collector.yml +++ b/.github/workflows/ci-collector.yml @@ -34,16 +34,13 @@ jobs: - name: Build Collector Executable for ${{ matrix.architecture }} architecture run: GOARCH=${{ matrix.architecture }} make package working-directory: collector + - name: Get Lambda Layer amd64 architecture value + if: ${{ matrix.architecture == 'amd64' }} + run: echo LAMBDA_LAYER_ARCHITECTURE=x86 | tee --append $GITHUB_ENV + - name: Get Lambda Layer arm64 architecture value + if: ${{ matrix.architecture == 'arm64' }} + run: echo LAMBDA_LAYER_ARCHITECTURE=ARM | tee --append $GITHUB_ENV - 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)" + grep ${{ env.LAMBDA_LAYER_ARCHITECTURE }} <<< "$(file collector)"