Skip to content

Commit 52eef46

Browse files
committed
added markdowons file, and improved some cpp files
1 parent 4abdf67 commit 52eef46

45 files changed

Lines changed: 3731 additions & 761 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build artifacts
2+
server
3+
*.o
4+
*.a
5+
6+
# Git
7+
.git
8+
.gitignore
9+
10+
# Documentation (not needed in container)
11+
*.md
12+
reports/
13+
14+
# Test files
15+
tests/
16+
k6/
17+
locust/
18+
19+
# IDE files
20+
.vscode/
21+
.idea/
22+
23+
# Temporary files
24+
*.tmp
25+
*.log
26+
27+
# Node modules (if any)
28+
node_modules/
29+
30+
# OS files
31+
.DS_Store
32+
Thumbs.db

.github/workflows/azure-static-web-apps-witty-beach-0c37f4400.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: C++ HTTP Server CI/CD
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y libboost-all-dev nlohmann-json3-dev libssl-dev libsqlite3-dev cmake curl
20+
21+
- name: Build bcrypt library
22+
run: |
23+
cd bcrypt
24+
mkdir -p build
25+
cd build
26+
cmake ..
27+
make
28+
cd ../..
29+
30+
- name: Build server
31+
run: |
32+
make clean
33+
make
34+
35+
- name: Test server startup
36+
run: |
37+
timeout 10s ./server &
38+
sleep 5
39+
curl -f http://localhost:8080/health || exit 1
40+
pkill -f "./server" || true
41+
42+
- name: Run API tests
43+
run: |
44+
./server &
45+
SERVER_PID=$!
46+
sleep 3
47+
48+
# Test endpoints
49+
curl -f http://localhost:8080/ || exit 1
50+
curl -f http://localhost:8080/sys-server-info?sysInfo=true || exit 1
51+
52+
kill $SERVER_PID || true
53+
54+
docker:
55+
runs-on: ubuntu-latest
56+
needs: test
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Build Docker image
62+
run: docker build -t cpp-http-server .
63+
64+
- name: Test Docker container
65+
run: |
66+
docker run -d -p 8080:8080 --name test-server cpp-http-server
67+
sleep 10
68+
curl -f http://localhost:8080/health || exit 1
69+
docker stop test-server
70+
docker rm test-server
71+
72+
security:
73+
runs-on: ubuntu-latest
74+
75+
steps:
76+
- uses: actions/checkout@v4
77+
78+
- name: Run security scan
79+
uses: securecodewarrior/github-action-add-sarif@v1
80+
with:
81+
sarif-file: 'security-scan.sarif'
82+
continue-on-error: true

0 commit comments

Comments
 (0)