name: Test web app on: [push,workflow_dispatch] jobs: flask: name: Test server with Flask Dev Mode 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 pyOpenSSL - 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