Gem2Browser/.forgejo/workflows/test.yml
swee 25b6af7e4a
Some checks failed
Test web app / Test server with Flask Dev Mode (push) Failing after 31s
Test web app / Test server with Hypercorn (ASGI) (push) Successful in 1m34s
Test web app / Test server with Gunicorn (WSGI) (push) Successful in 36s
Update .forgejo/workflows/test.yml
2025-01-19 12:29:55 -08:00

69 lines
No EOL
2.4 KiB
YAML

name: Test web app
on: [push,workflow_dispatch]
jobs:
flask:
name: Test server with Flask Dev Mode
runs-on: alpine
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: apk update && apk add py3-flask py3-openssl curl wget
- name: Run server
run: python3 server.py > log.log &
- name: Test server homepage
run: curl 127.0.0.1:2009
- name: Test server relay
run: curl 127.0.0.1:2009/gem?gemini=gem.swee.codes
- name: Test server certificate generation
run: wget http://127.0.0.1:2009/gencert.zip && unzip gencert.zip
- name: Kill server
if: always()
run: pkill python3
- name: Show logs
if: always()
run: cat log.log
hypercorn:
name: Test server with Hypercorn (ASGI)
runs-on: docker
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: apt update && apt install python3-pip curl wget -y && pip install --break-system-packages flask hypercorn pyOpenSSL
- name: Run server
run: hypercorn --bind=127.0.0.1:1234 server:app > log.log &
- name: Test server homepage
run: curl 127.0.0.1:1234
- name: Test server relay
run: curl 127.0.0.1:1234/gem?gemini=gem.swee.codes
- name: Test server certificate generation
run: wget http://127.0.0.1:1234/gencert.zip && unzip gencert.zip
- name: Kill server
if: always()
run: pkill hypercorn
- name: Show logs
if: always()
run: cat log.log
gunicorn:
name: Test server with Gunicorn (WSGI)
runs-on: docker
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: apt update && apt install python3-pip curl wget -y && pip install --break-system-packages flask gunicorn pyOpenSSL
- name: Run server
run: gunicorn -w 4 -b 127.0.0.1:1234 'server:app' > log.log &
- name: Test server homepage
run: curl 127.0.0.1:1234
- name: Test server relay
run: curl 127.0.0.1:1234/gem?gemini=gem.swee.codes
- name: Test server certificate generation
run: wget http://127.0.0.1:1234/gencert.zip && unzip gencert.zip
- name: Kill server
if: always()
run: pkill gunicorn
- name: Show logs
if: always()
run: cat log.log