- build backend and frontend with cacheing using GHA cache) - streamline frontend image to reduce layers - setup local swarm with test/setup.sh script, wait for containers to init - copy sample config files as default (add storages.sample.yaml) - add initial backend test for logging in with default superadmin credentials via 127.0.0.1:9871 - must use 127.0.0.1 instead of localhost for accessing frontend container within action
67 lines
1.6 KiB
YAML
67 lines
1.6 KiB
YAML
name: Browsertrix Cloud Integration Test (for Swarm)
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
btrix-swarm-test:
|
|
runs-on: ubuntu-20.04
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
driver-opts: network=host
|
|
|
|
-
|
|
name: Copy Configs
|
|
run: cp ./configs/config.sample.env ./configs/config.env; cp ./configs/storages.sample.yaml ./configs/storages.yaml
|
|
|
|
-
|
|
name: Build Backend
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: backend
|
|
push: true
|
|
tags: localhost:5000/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:5000/webrecorder/browsertrix-frontend:latest
|
|
cache-from: type=gha,scope=frontend
|
|
cache-to: type=gha,scope=frontend,mode=max
|
|
|
|
-
|
|
name: Run Bootstrap Script
|
|
run: ./test/setup.sh
|
|
|
|
-
|
|
name: Install Python
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: '3.9'
|
|
|
|
-
|
|
name: Install Python Libs
|
|
run: pip install pytest requests
|
|
|
|
-
|
|
name: Backend Tests
|
|
run: py.test -vv ./backend/test/*.py
|
|
|