-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Test on kubernetes | ||
|
||
on: | ||
# only work when code is on main branch | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'enh/kube' | ||
|
||
|
||
jobs: | ||
create-cluster: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
cluster_name: basegun-testing | ||
wait: 60s | ||
verbosity: 2 | ||
config: /tmp/ | ||
|
||
- name: Set up ingress controller | ||
run: | | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | ||
kubectl wait --namespace ingress-nginx \ | ||
--for=condition=ready pod \ | ||
--selector=app.kubernetes.io/component=controller \ | ||
--timeout=90s | ||
- name: Set up Helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: v3.11.2 | ||
|
||
- name: Add hosts to /etc/hosts | ||
run: | | ||
sudo echo "127.0.0.1 basegun.kubernetes.local" | sudo tee -a /etc/hosts | ||
- name: Checkout to code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install basegun with helm and test is running | ||
run: | | ||
helm upgrade --install basegun ./infra/kube/basegun/ \ | ||
--set="ingress.hosts[0].host=basegun.kubernetes.local,ingress.hosts[0].paths[0].path=/" | ||
--wait | ||
kubectl rollout status deploy basegun-backend basegun-frontend --timeout=300s | ||
- name: Test unitests on backend | ||
run : | | ||
kubectl exec basegun-backend -- python -m unittest discover -v | ||
- name: Test frontend | ||
run: | | ||
curl -o /dev/null basegun.kubernetes.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters