Skip to content

Commit 819d37c

Browse files
committed
CI workflow
1 parent 526a0e4 commit 819d37c

File tree

2 files changed

+14
-69
lines changed

2 files changed

+14
-69
lines changed

.env

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/unittest.yml

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ on:
1111
jobs:
1212
setup:
1313
runs-on: ubuntu-latest
14-
outputs:
15-
cache-hit: ${{ steps.cache-deps.outputs.cache-hit }}
1614
strategy:
1715
matrix:
1816
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
@@ -37,23 +35,6 @@ jobs:
3735
with:
3836
python-version: ${{ matrix.python-version }}
3937

40-
# Step 4: Cache dependencies
41-
- name: Cache dependencies
42-
id: cache-deps
43-
uses: actions/cache@v3
44-
with:
45-
path: ~/.cache/pip
46-
key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
47-
48-
# Step 5: Install dependencies if not cached
49-
- name: Install dependencies
50-
if: steps.cache-deps.outputs.cache-hit != 'true'
51-
run: |
52-
python -m pip install --upgrade pip
53-
pip install setuptools wheel
54-
pip install .
55-
pip install pytest
56-
5738
# Step 6: Create .env file
5839
- name: Create .env file
5940
run: |
@@ -76,42 +57,6 @@ jobs:
7657
- name: Verify .env file
7758
run: cat .env
7859

79-
test:
80-
needs: setup # Ensure setup is completed before running tests
81-
runs-on: ubuntu-latest
82-
strategy:
83-
matrix:
84-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
85-
fail-fast: false # Ensures all test jobs run even if one fails
86-
87-
steps:
88-
# Step 1: Checkout correct branch
89-
- name: Checkout Code
90-
uses: actions/checkout@v3
91-
with:
92-
ref: 315-Unittest-via-Github-actions # Ensure correct branch
93-
94-
# Step 2: Restore Cached Dependencies
95-
- name: Restore Cached Dependencies
96-
uses: actions/cache@v3
97-
with:
98-
path: ~/.cache/pip
99-
key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
100-
101-
# Step 3: Set up Python
102-
- name: Set up Python ${{ matrix.python-version }}
103-
uses: actions/setup-python@v4
104-
with:
105-
python-version: ${{ matrix.python-version }}
106-
107-
# Step 4: Install dependencies (if cache is empty)
108-
- name: Install dependencies (if needed)
109-
run: |
110-
python -m pip install --upgrade pip
111-
pip install setuptools wheel
112-
pip install .
113-
pip install pytest
114-
11560
# Step 8: Start FIWARE services
11661
- name: Start FIWARE Services
11762
run: |
@@ -127,9 +72,23 @@ jobs:
12772
curl -s http://localhost:8668/version && break || sleep 5
12873
done
12974
75+
# Step 4: Install dependencies (if cache is empty)
76+
- name: Install dependencies (if needed)
77+
run: |
78+
python -m pip install --upgrade pip
79+
pip install setuptools wheel
80+
pip install .
81+
pip install pytest
82+
13083
# Step 10: Debug - Show Running Docker Containers
13184
- name: Debug - Show Running Docker Containers
13285
run: docker ps -a
86+
87+
# Step 6: Navigate back to tests folder
88+
- name: Navigate to Tests Folder
89+
run: |
90+
cd $GITHUB_WORKSPACE
91+
ls -la
13392
13493
# Step 6: Run Tests
13594
- name: Run tests with unittest and pytest

0 commit comments

Comments
 (0)