-
-
Notifications
You must be signed in to change notification settings - Fork 34
74 lines (60 loc) · 2.23 KB
/
microk8s-ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Cluster Run (MicroK8s)
on:
push:
branches:
- main
paths:
- 'backend/**'
- 'chart/**'
env:
ECHO_SERVER_HOST_URL: http://10.0.1.1:18080
jobs:
btrix-microk8s-test:
runs-on: ubuntu-latest
steps:
- uses: balchua/[email protected]
with:
channel: '1.25/stable'
addons: '["dns", "helm3", "hostpath-storage", "registry", "host-access"]'
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Wait for registry to be available
run: curl --retry 20 --retry-delay 10 --retry-connrefused http://localhost:32000/v2/
- name: Build Backend
uses: docker/build-push-action@v3
with:
context: backend
push: true
tags: localhost:32000/webrecorder/browsertrix-backend:latest
cache-from: type=gha,scope=backend
cache-to: type=gha,scope=backend,mode=max
- name: Build Frontend
uses: docker/build-push-action@v3
with:
context: frontend
push: true
tags: localhost:32000/webrecorder/browsertrix-frontend:latest
cache-from: type=gha,scope=frontend
cache-to: type=gha,scope=frontend,mode=max
- name: Create Secret
run: sudo microk8s kubectl create secret generic btrix-subs-app-secret --from-literal=BTRIX_SUBS_APP_URL=${{ env.ECHO_SERVER_HOST_URL }}/portalUrl
- name: Start Cluster with Helm
run: |
sudo microk8s helm3 upgrade --install -f ./chart/values.yaml -f ./chart/test/test.yaml -f ./chart/test/microk8s-ci.yaml btrix ./chart/
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install Python Libs
run: pip install -r ./backend/test-requirements.txt
- name: Wait for all pods to be ready
run: sudo microk8s kubectl wait --for=condition=ready pod --all --timeout=240s
- name: Run Tests
run: pytest -vv ./backend/test/test_*.py
- name: Print Backend Logs
if: ${{ failure() }}
run: sudo microk8s kubectl logs svc/browsertrix-cloud-backend