browsertrix/.github/workflows/microk8s-ci.yaml
Tessa Walsh 14b349443f
Make pending invites expire via TTL index (#568)
* Make invites expire after configurable window

The value can be set in EXPIRE_AFTER_SECONDS env var and via
helm chart values, and defaults to 7 days.

* Create nightly test CI and add invite expiration test to it

* Update 404 error message for missing or expired invite

---------

Co-authored-by: sua yoo <sua@suayoo.com>
2023-02-14 16:07:14 -05:00

68 lines
2.0 KiB
YAML

name: Cluster Run (MicroK8s)
on:
push:
branches:
- main
paths:
- 'backend/**'
- 'chart/**'
jobs:
btrix-microk8s-test:
runs-on: ubuntu-latest
steps:
- uses: balchua/microk8s-actions@v0.3.1
with:
channel: '1.25/stable'
addons: '["dns", "helm3", "hostpath-storage", "registry", "metrics-server"]'
- 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: 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 pytest requests
- 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/*.py
- name: Print Backend Logs
if: ${{ failure() }}
run: sudo microk8s kubectl logs svc/browsertrix-cloud-backend