Skip to content

Commit

Permalink
Prototype github actions for testing K8s bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Mar 18, 2021
1 parent da0b52a commit 1236529
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,27 @@ jobs:

- name: Run E2E tests
run: bundle exec rake test:e2e

k8s-tests:
runs-on: ubuntu-latest
name: Kubernetes tests
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v2
- name: Create kind cluster
uses: container-tools/kind-action@v1
- name: Apply ondemand RBAC
run: kubectl apply -f hooks/ondemand.yaml
- name: Get ondemand token
id: token
run: |
TOKEN_NAME=$(kubectl describe serviceaccount ondemand -n ondemand | grep Tokens | awk '{ print $2 }')
TOKEN=$(kubectl describe secret $TOKEN_NAME -n ondemand | grep "token:" | awk '{ print $2 }')
echo "::set-output name=ondemand::${TOKEN}"
- name: Setup kubectl
run: |
kubectl config set-credentials ondemand --token="${{ steps.token.outputs.ondemand }}"
kubectl config set-context ondemand --cluster=kind --user=ondemand
kubectl config use-context ondemand
- name: Test k8s-bootstrap
run: /bin/bash hooks/k8s-bootstrap-ondemand.sh test hooks/hook.env.example

0 comments on commit 1236529

Please sign in to comment.