Skip to content

Commit 9165b5c

Browse files
committed
Safe TensorFlow installation
1 parent 1c1c8fb commit 9165b5c

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
# The Strategy Matrix defines the environments to test.
2828
# GitHub Actions will spawn a separate, parallel job for each version in the list.
2929
strategy:
30+
fail-fast: false
3031
matrix:
3132
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3233

@@ -35,21 +36,27 @@ jobs:
3536

3637
steps:
3738
- name: Checkout Repository
38-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
3940

4041
# Setup the specific Python version defined in the current matrix iteration.
4142
- name: Setup Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@v4
43+
uses: actions/setup-python@v5
4344
with:
4445
python-version: ${{ matrix.python-version }}
4546

4647
# Install project dependencies from requirements.txt.
4748
- name: Install Dependencies
4849
run: |
4950
python -m pip install --upgrade pip
50-
pip install -r requirements.txt
51+
# Added timeout and no-cache to prevent SSL/Network decryption errors
52+
pip install --default-timeout=100 --no-cache-dir -r requirements.txt
53+
5154
if [ "${{ matrix.python-version }}" != "3.14" ] && [ "${{ matrix.python-version }}" != "3.8" ]; then
52-
pip install tensorflow
55+
# Using a retry loop for large DL frameworks to handle transient network issues
56+
for i in {1..3}; do
57+
pip install --default-timeout=100 --no-cache-dir tensorflow && break || \
58+
(echo "Retry $i failed, waiting 10s..." && sleep 10)
59+
done
5360
pip install --upgrade keras
5461
pip install torch
5562
fi
@@ -64,7 +71,7 @@ jobs:
6471
# Install the newly built .whl file to verify the package is installable.
6572
- name: Install PyGAD from Wheel
6673
run: |
67-
find ./dist/*.whl | xargs pip install
74+
pip install dist/*.whl
6875
6976
- name: Install PyTest
7077
run: pip install pytest
@@ -78,4 +85,4 @@ jobs:
7885
pytest --ignore=tests/test_kerasga.py --ignore=tests/test_torchga.py
7986
else
8087
pytest
81-
fi
88+
fi

0 commit comments

Comments
 (0)