diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 12e11ee..46fe4ab 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -1,7 +1,30 @@ name: Test web app on: [push,workflow_dispatch] jobs: - check: + 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 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 runs-on: docker steps: - uses: actions/checkout@v4 @@ -11,11 +34,11 @@ jobs: - name: Run server run: hypercorn --bind=127.0.0.1:1234 server:app > log.log & - name: Test server homepage - run: curl localhost:1234 + run: curl 127.0.0.1:1234 - name: Test server relay - run: curl localhost:1234/gem?gemini=gem.swee.codes + run: curl 127.0.0.1:1234/gem?gemini=gem.swee.codes - name: Test server certificate generation - run: wget http://localhost:1234/gencert.zip && unzip gencert.zip + run: wget http://127.0.0.1:1234/gencert.zip && unzip gencert.zip - name: Kill server if: always() run: pkill hypercorn