Skip to content

Commit

Permalink
Update ci_cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Wambaforestin authored Oct 28, 2024
1 parent ef81d5a commit 6eab97f
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: CI Workflow
name: CI/CD Workflow

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
test:
build:
runs-on: ubuntu-latest

steps:
Expand All @@ -20,21 +16,19 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.7'

- name: Find and Install Dependencies
run: |
python -m pip install --upgrade pip
# Find all requirements.txt files and install dependencies for each
for req_file in $(find . -name "requirements.txt"); do
echo "Installing dependencies from $req_file"
pip install -r "$req_file"
done
python-version: '3.12.7'

- name: Run Tests
- name: Install dependencies for each subproject
run: |
# Run tests in each subproject that contains tests
for test_dir in $(find . -type d -name "tests"); do
echo "Running tests in $test_dir"
pytest "$test_dir"
# Loop through each subproject directory
for dir in projects/*; do
if [ -d "$dir" ]; then
echo "Installing dependencies for $dir"
# Check if requirements.txt exists in the subproject
if [ -f "$dir/requirements.txt" ]; then
pip install -r "$dir/requirements.txt"
else
echo "No requirements.txt found in $dir"
fi
fi
done

0 comments on commit 6eab97f

Please sign in to comment.