Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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/checkout@v2.3.4
# Setup kind cluster
- uses: engineerd/setup-kind@v0.5.0
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