Update .forgejo/workflows/test.yml
This commit is contained in:
parent
1e11dcd447
commit
8e05fe76dd
1 changed files with 27 additions and 4 deletions
|
@ -1,7 +1,30 @@
|
||||||
name: Test web app
|
name: Test web app
|
||||||
on: [push,workflow_dispatch]
|
on: [push,workflow_dispatch]
|
||||||
jobs:
|
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
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -11,11 +34,11 @@ jobs:
|
||||||
- name: Run server
|
- name: Run server
|
||||||
run: hypercorn --bind=127.0.0.1:1234 server:app > log.log &
|
run: hypercorn --bind=127.0.0.1:1234 server:app > log.log &
|
||||||
- name: Test server homepage
|
- name: Test server homepage
|
||||||
run: curl localhost:1234
|
run: curl 127.0.0.1:1234
|
||||||
- name: Test server relay
|
- 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
|
- 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
|
- name: Kill server
|
||||||
if: always()
|
if: always()
|
||||||
run: pkill hypercorn
|
run: pkill hypercorn
|
||||||
|
|
Loading…
Add table
Reference in a new issue