Gem2Browser/.forgejo/workflows/test.yml

24 lines
849 B
YAML
Raw Normal View History

2025-01-18 18:49:10 -08:00
name: Test web app
on: [push,workflow_dispatch]
jobs:
check:
runs-on: docker
steps:
- uses: actions/checkout@v4
2025-01-18 19:57:29 -08:00
- uses: actions/setup-python@v5
2025-01-18 18:49:10 -08:00
- name: Install dependencies
2025-01-18 18:55:46 -08:00
run: apt update && apt install python3-pip curl wget -y && pip install --break-system-packages flask hypercorn pyOpenSSL
2025-01-18 18:54:10 -08:00
- name: Run server
2025-01-18 22:13:44 -08:00
run: hypercorn --bind=127.0.0.1:1234 server:app > log.log &
2025-01-18 18:54:10 -08:00
- name: Test server homepage
2025-01-18 22:13:44 -08:00
run: curl localhost:1234
2025-01-18 18:54:10 -08:00
- name: Test server relay
2025-01-18 22:13:44 -08:00
run: curl localhost:1234/gem?gemini=gem.swee.codes
2025-01-18 18:55:46 -08:00
- name: Test server certificate generation
2025-01-18 22:13:44 -08:00
run: wget http://localhost:1234/gencert.zip && unzip gencert.zip
2025-01-18 18:54:10 -08:00
- name: Kill server
2025-01-18 18:59:02 -08:00
if: always()
2025-01-18 22:15:44 -08:00
run: pkill hypercorn
2025-01-18 18:59:02 -08:00
- name: Show logs
if: always()
run: cat log.log