test: add integration testing #18
Workflow file for this run
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
name: Integration Test | |
on: | |
pull_request: | |
jobs: | |
k8s: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
cluster: | |
- cluster-01 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: start minikube | |
id: minikube | |
uses: medyagh/setup-minikube@latest | |
- name: Setup namespace | |
run: | | |
kubectl config set-context --current --namespace=openedx-harmony | |
- name: Helm dependency add | |
run: | | |
helm dependency list charts/harmony-chart 2> /dev/null | tail +2 | awk '{ print "helm" " repo add " $1 " " $3 }' | while read cmd; do $cmd || true; done | |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.crds.yaml --namespace=harmony | |
- name: Helm dependency build | |
run: | | |
helm dependency update charts/harmony-chart | |
helm dependency build charts/harmony-chart | |
- name: Helm install | |
run: | | |
helm install harmony --namespace harmony --create-namespace -f integration-test/${{matrix.cluster}}/values.yaml charts/harmony-chart | |
- name: Setup domain | |
run: | | |
export CLUSTER_HTTP_URL=$(minikube service harmony-ingress-nginx-controller -n harmony --url | head -n 1) | |
curl $CLUSTER_HTTP_URL/cluster-echo-test -H "host: harmony.test" | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install openedx | |
run: | | |
export INSTALLATIONS=$(ls -d integration-test/${{matrix.cluster}}/*/) | |
export CI_ROOT=$(pwd) | |
for i in $(ls -d integration-test/cluster-01/*/) | |
do | |
echo "Running for installation $i" | |
cd $i | |
export TUTOR_PLUGINS_ROOT=$(pwd)/plugins/ export TUTOR_ROOT=$(pwd) | |
python3 -m venv venv && source venv/bin/activate | |
pip install -r $TUTOR_ROOT/requirements.txt | |
tutor config save -i | |
tutor plugins enable k8s_harmony | |
tutor k8s start | |
tutor k8s init | |
cd $CI_ROOT | |
deactivate | |
done |