Skip to content

Commit c957860

Browse files
authored
Merge branch 'main' into experimental/finalest-final-merge-maybe
2 parents c597180 + 1c4f664 commit c957860

File tree

2 files changed

+61
-17
lines changed

2 files changed

+61
-17
lines changed

.github/workflows/ci.yml

+56-16
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ jobs:
2222
with:
2323
python-version: 3.11 # Use Python version 3.11
2424

25-
# Cache dependencies
26-
- name: Cache pip
27-
uses: actions/cache@v3
28-
with:
29-
path: ~/.cache/pip
30-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
31-
restore-keys: |
32-
${{ runner.os }}-pip-
33-
3425
# Install build dependencies
3526
- name: Install build dependencies
3627
run: |
@@ -41,12 +32,51 @@ jobs:
4132
- name: Install dependencies
4233
run: pip install -r requirements.txt # Install dependencies from requirements.txt
4334

35+
test:
36+
needs: setup
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v3
41+
42+
- name: Set up Python 3.11
43+
uses: actions/setup-python@v3
44+
with:
45+
python-version: 3.11
46+
47+
# Install build dependencies
48+
- name: Install build dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install setuptools==58.0.4 wheel
52+
53+
- name: Install dependencies
54+
run: pip install -r requirements.txt
55+
56+
# Run test suite
57+
- name: Run tests
58+
run: pytest # Execute tests using pytest
59+
4460
security:
4561
needs: setup
4662
runs-on: ubuntu-latest
4763
steps:
4864
- name: Checkout code
49-
uses: actions/checkout@v4
65+
uses: actions/checkout@v3
66+
67+
- name: Set up Python 3.11
68+
uses: actions/setup-python@v3
69+
with:
70+
python-version: 3.11
71+
72+
# Install build dependencies
73+
- name: Install build dependencies
74+
run: |
75+
python -m pip install --upgrade pip
76+
pip install setuptools==58.0.4 wheel
77+
78+
- name: Install dependencies
79+
run: pip install -r requirements.txt
5080

5181
# Run security checks
5282
- name: Run security checks
@@ -59,11 +89,26 @@ jobs:
5989
runs-on: ubuntu-latest
6090
steps:
6191
- name: Checkout code
62-
uses: actions/checkout@v4
92+
uses: actions/checkout@v3
93+
94+
- name: Set up Python 3.11
95+
uses: actions/setup-python@v3
96+
with:
97+
python-version: 3.11
98+
99+
# Install build dependencies
100+
- name: Install build dependencies
101+
run: |
102+
python -m pip install --upgrade pip
103+
pip install setuptools==58.0.4 wheel
104+
105+
- name: Install dependencies
106+
run: pip install -r requirements.txt
63107

64108
# Build the Docker image
65109
- name: Build Docker image
66110
run: docker build -t transcendence .
111+
run: docker build -t transcendence .
67112

68113
deploy:
69114
needs: build
@@ -84,9 +129,4 @@ jobs:
84129
85130
# Conditional deployment based on branch
86131
- name: Deploy to server
87-
if: github.ref == 'refs/heads/main'
88132
run: ssh user@server "docker pull ${DOCKER_HUB_USERNAME}/transcendence:latest && docker-compose up --build -d"
89-
90-
- name: Deploy to development server
91-
if: github.ref == 'refs/heads/develop'
92-
run: ssh user@dev-server "docker pull ${DOCKER_HUB_USERNAME}/transcendence:latest && docker-compose up --build -d"

docker-compose.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ services:
2121
image: redis:alpine
2222
networks:
2323
- transcendence_network
24-
# command: ["CMD", "redis-cli", "--raw", "incr", "ping"]
24+
healthcheck:
25+
test: ["CMD", "redis-cli", "ping"]
26+
interval: 30s
27+
timeout: 10s
28+
retries: 5
2529

2630
user-service:
2731
container_name: user-service

0 commit comments

Comments
 (0)