Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lenardchristopher/d214f36fe0502c323dfc8942fee963f8 to your computer and use it in GitHub Desktop.
Save lenardchristopher/d214f36fe0502c323dfc8942fee963f8 to your computer and use it in GitHub Desktop.
name: Testing
on:
- pull_request
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: make unit-test
integration-tests:
needs: unit-tests
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
# Setup kind cluster
- uses: engineerd/[email protected]
with:
wait: 300s
version: v0.11.1
image: kindest/node:v1.20.7
# Get secrets from Azure
- name: Azure Login
uses: Azure/login@v1
with:
creds: '{"clientId":"99999999-9999-9999-9999-999999999999","clientSecret":"${{ secrets.SERVICE_PRINCIPAL_SECRET }}","subscriptionId":"99999999-9999-9999-9999-999999999999","tenantId":"99999999-9999-9999-9999-999999999999"}'
- uses: Azure/get-keyvault-secrets@v1
with:
keyvault: "k8s-ci-kv"
secrets: "dev-acr-client-secret"
id: myGetSecretAction
# Setup Go
- uses: actions/setup-go@v2
with:
go-version: '1.16'
# Setup required tools
- name: Install Operator SDK
run: |
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v${{ env.OPERATOR_SDK_VERSION }}/operator-sdk-v${{ env.OPERATOR_SDK_VERSION }}-x86_64-linux-gnu
chmod +x operator-sdk-v${{ env.OPERATOR_SDK_VERSION }}-x86_64-linux-gnu
mv operator-sdk-v${{ env.OPERATOR_SDK_VERSION }}-x86_64-linux-gnu /usr/local/bin/operator-sdk
env:
OPERATOR_SDK_VERSION: 0.19.2
# Run tests
- name: E2E Tests
run: make integration-test
env:
ACR_CLIENT_SECRET: ${{ steps.myGetSecretAction.outputs.dev-acr-client-secret }}
TEST_USE_EXISTING_CLUSTER: "true"
WATCH_NAMESPACE: ""
OPERATOR_NAME: "helloworld"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment