Skip to content

Add initial HTTPS web page #17

Add initial HTTPS web page

Add initial HTTPS web page #17

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: custom-https-server CI
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "0 9 1 * *"
jobs:
test-server:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install psutil
- name: Test server starts on port 8080
working-directory: ./custom-https-server
run: |
echo "Launching server on port 8080..."
timeout 30 python3 custom_https_server.py --path . --port 8080 --bind 127.0.0.1 --mode read --user admin --pass password > /tmp/server8080.log 2>&1 &
SERVER_PID=$!
echo "Server PID: $SERVER_PID"
sleep 10
if ps -p $SERVER_PID > /dev/null 2>&1; then
echo "✅ Server process started successfully on port 8080"
kill $SERVER_PID 2>/dev/null || true
exit 0
else
echo "❌ Server process failed to start"
echo "=== Server logs ==="
cat /tmp/server8080.log
exit 1
fi
shell: bash
- name: Test server starts on port 8081
run: |
echo "Creating test file in /tmp..."
echo "Hello from /tmp" > /tmp/test.txt
echo "Launching server on port 8081..."
timeout 30 python3 ./custom-https-server/custom_https_server.py --path /tmp --port 8081 --bind 127.0.0.1 --mode read --user admin --pass password > /tmp/server8081.log 2>&1 &
SERVER_PID=$!
echo "Server PID: $SERVER_PID"
sleep 10
if ps -p $SERVER_PID > /dev/null 2>&1; then
echo "✅ Server process started successfully on port 8081"
kill $SERVER_PID 2>/dev/null || true
exit 0
else
echo "❌ Server process failed to start"
echo "=== Server logs ==="
cat /tmp/server8081.log
exit 1
fi
shell: bash