Skip to content

Commit cba0512

Browse files
committed
refactor(boost-clone): rely on setup-python
1 parent c64ea6e commit cba0512

File tree

1 file changed

+3
-33
lines changed

1 file changed

+3
-33
lines changed

boost-clone/action.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,41 +53,11 @@ inputs:
5353
runs:
5454
using: "composite"
5555
steps:
56-
- name: Find python
57-
shell: bash
58-
id: find-python
59-
if: inputs.modules != '' || inputs.scan-modules-dir != ''
60-
run: |
61-
# Looking for python
62-
${{ (inputs.trace-commands == 'true' && 'set -xe') || '' }}
63-
if command -v python3 &> /dev/null; then
64-
python_path="$(which python3)"
65-
elif command -v python &> /dev/null; then
66-
python_version_output=$(python --version)
67-
regex='[0-9]+\.[0-9]+\.[0-9]+'
68-
[[ $python_version_output =~ $regex ]]
69-
python_version=${BASH_REMATCH[0]}
70-
IFS='.' read -r -a version_components <<< "$python_version"
71-
major_version=${version_components[0]}
72-
if [ "$major_version" -lt 3 ]; then
73-
echo "Python $python_version found." >&2
74-
echo "Please install Python 3!" >&2
75-
else
76-
python_path="$(which python)"
77-
fi
78-
else
79-
echo "Cannot Python 3!" >&2
80-
fi
81-
if [ "$python_path" != "" ]; then
82-
$python_path --version
83-
echo "python_path=$python_path" >> $GITHUB_OUTPUT
84-
fi
85-
8656
- uses: actions/setup-python@v4
8757
if: (inputs.modules != '' || inputs.scan-modules-dir != '') && !steps.find-python.outputs.python_path
8858
id: setup-python
8959
with:
90-
python-version: '3.10'
60+
python-version: '>= 3.5'
9161

9262
- name: Scan Required Boost Modules
9363
if: inputs.scan-modules-dir != ''
@@ -101,7 +71,7 @@ runs:
10171
source_dir="$(readlink -f "$source_dir" 2>/dev/null || realpath -e "$source_dir" 2>/dev/null || echo "$(pwd)/$source_dir")"
10272
fi
10373
104-
python_path="${{ steps.find-python.outputs.python_path || steps.setup-python.outputs.python-path }}"
74+
python_path="${{ steps.setup-python.outputs.python-path }}"
10575
10676
# Go to action path to find the script and aux files
10777
# https://github.com/actions/runner/issues/716
@@ -306,7 +276,7 @@ runs:
306276
done
307277
308278
# Initialize dependencies of each explicitly specified module
309-
python_path="${{ steps.find-python.outputs.python_path || steps.setup-python.outputs.python-path }}"
279+
python_path="${{ steps.setup-python.outputs.python-path }}"
310280
python_exit_code=0
311281
for module in ${modules// / }
312282
do

0 commit comments

Comments
 (0)