Skip to content

Commit a253767

Browse files
committed
Fix macOS dependency installation in GitHub Actions
- Make brew update non-fatal - Add fallback logic for pip installation (try pip3, python3 -m pip, or ensurepip first) - This fixes the 'Install Dependencies' step failure on macOS runners
1 parent 3708604 commit a253767

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ runs:
2020
shell: bash
2121
run: |
2222
echo "Install Mac dependencies"
23-
brew update
23+
brew update || true
2424
## gmp and python are already installed in the latest macOS
2525
# brew install gmp
2626
# brew install python
27-
python3 -m pip install sympy
27+
if command -v pip3 &> /dev/null; then
28+
pip3 install sympy
29+
elif python3 -m pip --version &> /dev/null; then
30+
python3 -m pip install sympy
31+
else
32+
python3 -m ensurepip --upgrade || python3 -m ensurepip
33+
python3 -m pip install sympy
34+
fi
2835
echo "Install Mac dependencies [DONE]"

0 commit comments

Comments
 (0)