Skip to content

Commit

Permalink
fixed yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-Sagaydak committed Nov 10, 2024
1 parent aabeb2d commit 2a3bbf2
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ jobs:
uses: actions/checkout@v3

- run: sudo apt-get update
- run: sudo apt-get install g++ make cmake
- run: sudo apt-get install -y libboost-all-dev
- run: sudo apt-get install -y g++ make cmake libboost-all-dev libpqxx-dev docker-compose

- run: cd client && mkdir -p build && cd build && cmake .. && make && cd ../../server && mkdir -p build && cd build && cmake .. && make
- run: |
cd client && mkdir -p build && cd build && cmake .. && make
cd ../../server && mkdir -p build && cd build && cmake .. && make
- run: cd ../..

- run: sh create_debpkg_client.sh
- name: Upload client artifact
uses: actions/upload-artifact@v4
Expand All @@ -30,30 +31,27 @@ jobs:
with:
name: server
path: ./server/http-server.deb

- name: Test 1. Install client
run: sudo dpkg -i ./client/http-client.deb

- name: Test 2. Test client
run: echo "6" | libhv-client
- name: Test 3. Install server
run: sudo dpkg -i ./server/http-server.deb
- name: Test 4. Test server

- name: Start server and database with Docker Compose
run: docker-compose up -d

- name: Test server health
run: |
libhv-http & SERVER_PID=$!
sleep 5
sleep 10 # Даем время серверу на старт
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
- name: Stop Docker Compose
run: docker-compose down

- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand All @@ -62,7 +60,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/http-server:${{ github.sha }} .
run: docker-compose build http-server

- name: Push Docker image
run: docker push ${{ secrets.DOCKER_USERNAME }}/http-server:${{ github.sha }}

0 comments on commit 2a3bbf2

Please sign in to comment.