77 tags : ["**"]
88 workflow_dispatch :
99
10- defaults :
11- run :
12- shell : bash
1310
1411jobs :
1512 # Most of the "main", "auth" and "helm" jobs are the same and only differ
@@ -22,47 +19,29 @@ jobs:
2219 fail-fast : false
2320 matrix :
2421 include :
25- # This version of k3s uses kubernetes v1.18
26- - k3s-version : v1.18.10+k3s2
27- helm_version : v3.4.1
22+ - k3s-channel : v1.19
23+ helm-version : v3.5.0
2824 test : main
29- - k3s-version : v1.18.10+k3s2
30- helm_version : v3.4.1
25+ - k3s-channel : v1.19
26+ helm-version : v3.5.0
3127 test : auth
32- - k3s-version : v1.18.10+k3s2
33- helm_version : v3.4.1
28+ - k3s-channel : v1.19
29+ helm-version : v3.5.0
3430 test : helm
3531 steps :
3632 - uses : actions/checkout@v2
3733 with :
3834 # chartpress requires the full history
3935 fetch-depth : 0
40- -
uses :
jupyterhub/[email protected] 36+
37+ - uses : jupyterhub/action-k3s-helm@v1
4138 with :
4239 k3s-version : ${{ matrix.k3s-version }}
4340 helm-version : ${{ matrix.helm-version }}
4441 metrics-enabled : false
4542 traefik-enabled : false
4643 docker-enabled : true
47- - uses : actions/setup-python@v2
48- with :
49- python-version : ' 3.8'
50- - name : Display kubernetes related details
51- run : |
52- echo "kubeconfig: $KUBECONFIG"
53- echo
54- echo "List of running pods:"
55- kubectl get pods --all-namespaces
56- echo
57- echo "List of cluster nodes:"
58- kubectl get nodes
59- echo
60- echo "Helm list output:"
61- helm list
62- - name : Setup helm chart repositories
63- run : |
64- helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
65- helm repo update
44+
6645 - name : Setup OS level dependencies
6746 run : |
6847 sudo apt-get update
@@ -71,40 +50,54 @@ jobs:
7150 curl \
7251 libcurl4-openssl-dev \
7352 libssl-dev
53+
7454 - uses : actions/setup-node@v2-beta
7555 with :
7656 node-version : ' 14'
57+
7758 - name : Run webpack to build static assets
7859 run : |
7960 npm install
8061 npm run webpack
62+
63+ - uses : actions/setup-python@v2
64+ with :
65+ python-version : ' 3.8'
66+
8167 - name : Setup Python package dependencies
8268 run : |
8369 # Install development requirements, package requirements, and frozen image
8470 # requirements, with an increasing priority.
8571 pip install -r dev-requirements.txt
8672 pip install .
8773 pip install -r helm-chart/images/binderhub/requirements.txt
74+
8875 - name : Install JupyterHub chart for main tests
8976 if : matrix.test == 'main'
90- run : ./testing/local-binder-k8s-hub/install-jupyterhub-chart
77+ run : |
78+ ./testing/local-binder-k8s-hub/install-jupyterhub-chart
79+
9180 - name : Install JupyterHub chart for auth tests
9281 if : matrix.test == 'auth'
93- run : ./testing/local-binder-k8s-hub/install-jupyterhub-chart --auth
82+ run : |
83+ ./testing/local-binder-k8s-hub/install-jupyterhub-chart --auth
84+
9485 - name : Use chartpress to create the helm chart
9586 if : matrix.test == 'helm'
9687 run : |
9788 # Use chartpress to create the helm chart and build its images
9889 helm dependency update ./helm-chart/binderhub
9990 (cd helm-chart && chartpress)
100- git --no-pager diff
91+ git --no-pager diff --color=always
92+
10193 - name : Validate the chart against the k8s API
10294 if : matrix.test == 'helm'
10395 run : |
10496 helm template --validate binderhub-test helm-chart/binderhub \
10597 --values testing/k8s-binder-k8s-hub/binderhub-chart-config.yaml \
10698 --set config.BinderHub.hub_url=http://localhost:30902 \
10799 --set config.BinderHub.access_token=$GITHUB_ACCESS_TOKEN
100+
108101 - name : Install the chart
109102 if : matrix.test == 'helm'
110103 run : |
@@ -113,57 +106,48 @@ jobs:
113106 --set config.BinderHub.hub_url=http://localhost:30902 \
114107 --set config.BinderHub.hub_url_local=http://proxy-public \
115108 --set config.BinderHub.access_token=$GITHUB_ACCESS_TOKEN
109+
116110 - name : Wait for JupyterHub to be ready
117111 timeout-minutes : 10
118112 run : |
119- # Wait for JupyterHub to be ready
120- set -e
121113 . ci/common
122114 await_jupyterhub
123- # Next few commands are here for sanity checking/debugging of CI
124- # related issues
125- echo "Proxy service details"
126- kubectl get svc proxy-public -o json
127- echo
128- echo "kubectl describe svc proxy-public"
129- kubectl describe svc proxy-public
130- echo
131- echo "kubectl get svc"
132- kubectl get svc
133- echo
134115 echo "curl http://localhost:30902/hub/api/" should print the JupyterHub version
135116 curl http://localhost:30902/hub/api/
117+
136118 - name : Wait for BinderHub to be ready
137119 if : matrix.test == 'helm'
138120 timeout-minutes : 10
139121 run : |
140- # Wait for BinderHub to be ready
141- set -e
142122 . ci/common
143123 await_binderhub
144124 echo "curl http://localhost:30901/health" to check BinderHub\'s health
145125 curl http://localhost:30901/health
146- echo
126+
147127 - name : Run main tests
148128 if : matrix.test == 'main'
149129 # running the "main" tests means "all tests that aren't auth"
150130 run : pytest -m "not auth" -v --maxfail=10 --cov binderhub --durations=10 --color=yes
131+
151132 - name : Run auth tests
152133 if : matrix.test == 'auth'
153134 # running the "auth" tests means "all tests that are marked as auth"
154135 run : pytest -m "auth" -v --maxfail=10 --cov binderhub --durations=10 --color=yes
136+
155137 - name : Run helm tests
156138 if : matrix.test == 'helm'
157139 run : |
158140 export BINDER_URL=http://localhost:30901
159141 pytest -m "remote" -v --maxfail=10 --cov binderhub --durations=10 --color=yes
142+
143+ # GitHub Action reference: https://github.com/jupyterhub/action-k8s-namespace-report
160144 - name : Kubernetes namespace report
161- if : ${{ always() }}
162- run : |
163- # Display debugging information and always provide the logs from
164- # certain important k8s deployments.
165- . ci/common
166- full_namespace_report deploy/binder deploy/hub deploy/proxy
145+ uses : jupyterhub/action-k8s-namespace-report@v1
146+ if : always()
147+ with :
148+ important-workloads : deploy/binder deploy/hub deploy/proxy
149+
150+ # GitHub action reference: https://github.com/codecov/codecov-action
167151 - name : Upload coverage stats
168152 uses : codecov/codecov-action@v1
169153 if : ${{ always() }}
0 commit comments