Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Test Scripts CI job #5

Merged
merged 1 commit into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,25 @@ jobs:
- name: Run make verify-fmt
run: |
make verify-fmt

test-scripts:
name: Test Scripts
strategy:
matrix:
go-version: [ 1.16.x ]
platform: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Run make operator-sdk
run: |
make operator-sdk
9 changes: 7 additions & 2 deletions utils/install-operator-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -euo pipefail

ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n "$(uname -m)" ;; esac)
case $(uname -m) in x86_64|aarch64) ARCH="amd64";; *) ARCH="$(uname -m)";; esac
OS=$(uname | awk '{print tolower($0)}')
OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${2}
OPERATOR_SDK_DL_BINARY=${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
Expand All @@ -20,7 +20,12 @@ if [ ! -f "$1" ]; then
curl -sLO ${OPERATOR_SDK_DL_URL}/checksums.txt
curl -sLO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc
gpg -u "Operator SDK (release) <[email protected]>" --verify checksums.txt.asc
grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c -
if [[ $OS == 'darwin' ]]; then
grep operator-sdk_${OS}_${ARCH} checksums.txt | shasum -a 256 -c -
else
grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c -
fi
mkdir -p "$(dirname $1)"
chmod +x operator-sdk_${OS}_${ARCH} && mv operator-sdk_${OS}_${ARCH} $1

rm -rf $TMP_DIR
Expand Down