Test kubernetes in CI #8
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: Parsl | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
k8s-kind-suite: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@master | |
- name: Create k8s Kind Cluster | |
uses: helm/kind-action@v1 | |
with: | |
# kind tooling uses this name by default, but kind-action uses | |
# a different default name | |
cluster_name: kind | |
- name: Build docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: parsl:ci | |
- name: Push docker image into kubernetes cluster | |
run: | | |
kind load docker-image parsl:ci | |
- name: set liberal permissions | |
run: | | |
kubectl create clusterrolebinding serviceaccounts-cluster-admin --clusterrole=cluster-admin --group=system:serviceaccounts | |
- name: launch pytest Job | |
run: | | |
kubectl create -f ./pytest-task.yaml | |
- name: wait for pytest Job | |
run: | | |
# this pytest should take around 30 seconds to run, so 180 seconds | |
# should be plenty... | |
kubectl wait --timeout=180s --for=condition=Complete Job pytest | |
- name: report some info | |
if: ${{ always() }} | |
run: | | |
kubectl describe pods | |
kubectl describe jobs | |
kubectl logs Job/pytest |