From ffb0759f87493bccf9f986986e987b24bd1864c3 Mon Sep 17 00:00:00 2001 From: Alexey-Sagaydak Date: Sun, 28 Apr 2024 02:48:49 +0700 Subject: [PATCH] add server test --- .github/workflows/ci.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 73db06b..9789007 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: [push] jobs: - build: + build-test: runs-on: ubuntu-latest steps: @@ -39,4 +39,23 @@ jobs: run: echo "6" | libhv-client - name: Test 3. Install server - run: sudo dpkg -i ./server/http-server.deb \ No newline at end of file + run: sudo dpkg -i ./server/http-server.deb + + - name: Test 4. Test server + run: | + libhv-http + SERVER_PID=$! + + sleep 5 + + curl --silent --head http://localhost:7777 | grep "HTTP/1.1 200 OK" > /dev/null + + if [ "$?" -eq 0 ]; then + echo "Сервер успешно запущен" + kill $SERVER_PID + exit 0 + else + echo "Ошибка при запуске сервера" + kill $SERVER_PID + exit 1 + fi \ No newline at end of file