40 lines
1.8 KiB
YAML
40 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
tests-and-images:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
- name: Run backend tests
|
|
run: PYTHONPATH=backend python3 -m unittest discover -s backend -p 'test_*.py' -v
|
|
- name: Run Telegram bot tests
|
|
run: python3 -m unittest discover -s tools/telegram-bot -p 'test_*.py' -v
|
|
- name: Run infrastructure backup tests
|
|
run: python3 -m unittest discover -s infra/backup -p 'test_*.py' -v
|
|
- name: Check recovery host guard
|
|
run: bash infra/bootstrap/test-host-guard.sh
|
|
- name: Check infrastructure shell syntax
|
|
run: |
|
|
bash -n infra/bootstrap/bootstrap-ubuntu-24.04.sh infra/bootstrap/host-guard.sh \
|
|
infra/bootstrap/verify.sh infra/bootstrap/verify-helper.sh infra/deploy/install-helper.sh
|
|
- name: Run rollback helper tests
|
|
run: python3 -m unittest discover -s infra/deploy -p 'test_*.py' -v
|
|
- name: Validate production Compose and Caddyfile
|
|
run: |
|
|
secret_file=$(mktemp)
|
|
trap 'rm -f "$secret_file"' EXIT
|
|
REVIEW_SECRET_FILE="$secret_file" docker compose --env-file deploy/production/.env.example -f deploy/production/compose.yaml config --quiet
|
|
docker run --rm --entrypoint caddy -v "$PWD/deploy/production/Caddyfile:/etc/caddy/Caddyfile:ro" caddy:2.11.6-alpine@sha256:881bbc60f9986d5ab8e7cfd6cf7e4ef3c9c0439fef2429d035d065577882f028 validate --config /etc/caddy/Caddyfile --adapter caddyfile
|
|
- name: Build production images
|
|
run: |
|
|
docker build -f deploy/production/Dockerfile.backend -t akyldash-backend:ci .
|
|
docker build -f deploy/production/Dockerfile.opensearch -t akyldash-opensearch:ci .
|