File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -100,3 +100,38 @@ jobs:
100100
101101 pip install requests
102102 pip3 install s4cmd
103+
104+ test_python_version_file :
105+ runs-on : ubuntu-latest
106+ container : amazonlinux:2023
107+ steps :
108+ - name : Setup runner
109+ run : |
110+ yum install -y git tar gzip sudo
111+
112+ - uses : actions/checkout@v3
113+
114+ - name : Create python version file
115+ run : |
116+ echo '3.11.5' > .python-version
117+
118+ - name : Install python
119+ uses : ./
120+ with :
121+ python-version-file : " .python-version"
122+
123+ - name : Test installation
124+ run : |
125+ set -x
126+
127+ which python3
128+ which python
129+
130+ python3 --version
131+ python --version
132+
133+ python3 --version 2>&1 | grep -F "3.11.5"
134+ test "$(python3 -m pip --version)" = "$(pip3 --version)"
135+
136+ python --version 2>&1 | grep -F "3.11.5"
137+ test "$(python3 -m pip --version)" = "$(pip --version)"
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ name: 'Setup python amazon linux'
22description : ' setup-python action for amazon linux self hosted runners'
33inputs :
44 python-version :
5+ description : ' Version of python to be installed. Reads from .python-version if unset.'
6+ python-version-file :
57 description : ' Version of python to be installed'
6- required : true
8+ default : " .python-version "
79 cache :
810 description : Used to specify whether caching is needed. Set to true, if you'd like to enable caching.
911 required : true
2022 id : find-exact-python-version
2123 shell : bash
2224 run : |
23- exact_python_version=$(${GITHUB_ACTION_PATH}/find-exact-python-version.sh "${{ inputs.python-version }}")
25+ exact_python_version=$(${GITHUB_ACTION_PATH}/find-exact-python-version.sh "${{ inputs.python-version }}" "${{ inputs.python-version-file }}" )
2426 echo "exact_python_version=${exact_python_version}" >> $GITHUB_OUTPUT
2527
2628 - name : Set installation directory
Original file line number Diff line number Diff line change 33set -euo pipefail
44
55specified_version=" $1 "
6+ specified_version_file=" $2 "
67
78# This versions map should be kept in sync with
89# - https://www.python.org/downloads/
You can’t perform that action at this time.
0 commit comments