mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
Use toolcache for PyPy on Ubuntu 1604 and 1804
This commit is contained in:
@@ -27,13 +27,19 @@ for setup in $setups; do
|
|||||||
cd $original_directory;
|
cd $original_directory;
|
||||||
done;
|
done;
|
||||||
|
|
||||||
DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)"
|
DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) action)"
|
||||||
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
|
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
|
||||||
for python in $pythons; do
|
for python in $pythons; do
|
||||||
DocumentInstalledItemIndent "Python $python"
|
DocumentInstalledItemIndent "Python $python"
|
||||||
done;
|
done;
|
||||||
|
|
||||||
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)"
|
# PyPy is also configured using the setup-python action
|
||||||
|
pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy)
|
||||||
|
for pypy in $pypys; do
|
||||||
|
DocumentInstalledItemIndent "PyPy $pypy"
|
||||||
|
done;
|
||||||
|
|
||||||
|
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) action)"
|
||||||
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
|
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
|
||||||
for ruby in $rubys; do
|
for ruby in $rubys; do
|
||||||
DocumentInstalledItemIndent "Ruby $ruby"
|
DocumentInstalledItemIndent "Ruby $ruby"
|
||||||
|
|||||||
@@ -27,13 +27,19 @@ for setup in $setups; do
|
|||||||
cd $original_directory;
|
cd $original_directory;
|
||||||
done;
|
done;
|
||||||
|
|
||||||
DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)"
|
DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) action)"
|
||||||
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
|
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
|
||||||
for python in $pythons; do
|
for python in $pythons; do
|
||||||
DocumentInstalledItemIndent "Python $python"
|
DocumentInstalledItemIndent "Python $python"
|
||||||
done;
|
done;
|
||||||
|
|
||||||
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)"
|
# PyPy is also configured using the setup-python action
|
||||||
|
pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy)
|
||||||
|
for pypy in $pypys; do
|
||||||
|
DocumentInstalledItemIndent "PyPy $pypy"
|
||||||
|
done;
|
||||||
|
|
||||||
|
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) action)"
|
||||||
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
|
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
|
||||||
for ruby in $rubys; do
|
for ruby in $rubys; do
|
||||||
DocumentInstalledItemIndent "Ruby $ruby"
|
DocumentInstalledItemIndent "Ruby $ruby"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: python.sh
|
## File: python.sh
|
||||||
## Desc: Installs Python 2/3 and related tools (pip, pypy)
|
## Desc: Installs Python 2/3
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
@@ -10,47 +10,9 @@ source $HELPER_SCRIPTS/document.sh
|
|||||||
# Install Python, Python 3, pip, pip3
|
# Install Python, Python 3, pip, pip3
|
||||||
apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip
|
apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip
|
||||||
|
|
||||||
# Install PyPy 2.7 to $AGENT_TOOLSDIRECTORY
|
|
||||||
wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-linux64.tar.bz2
|
|
||||||
tar -x -C /tmp -f /tmp/pypy2.7-v7.1.0-linux64.tar.bz2
|
|
||||||
rm /tmp/pypy2.7-v7.1.0-linux64.tar.bz2
|
|
||||||
mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/2.7.13
|
|
||||||
mv /tmp/pypy2.7-v7.1.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64
|
|
||||||
touch $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64.complete
|
|
||||||
|
|
||||||
# add pypy to PATH by default
|
|
||||||
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy /usr/local/bin/pypy
|
|
||||||
# pypy will be the python in PATH when its tools cache directory is prepended to PATH
|
|
||||||
# PEP 394-style symlinking; don't bother with minor version
|
|
||||||
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2
|
|
||||||
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python
|
|
||||||
|
|
||||||
# Install latest Pip for PyPy2
|
|
||||||
$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m ensurepip
|
|
||||||
$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m pip install --ignore-installed pip
|
|
||||||
|
|
||||||
# Install PyPy 3.5 to $AGENT_TOOLSDIRECTORY
|
|
||||||
wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v7.0.0-linux64.tar.bz2
|
|
||||||
tar -x -C /tmp -f /tmp/pypy3.5-v7.0.0-linux64.tar.bz2
|
|
||||||
rm /tmp/pypy3.5-v7.0.0-linux64.tar.bz2
|
|
||||||
mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/3.5.3
|
|
||||||
mv /tmp/pypy3.5-v7.0.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64
|
|
||||||
touch $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64.complete
|
|
||||||
|
|
||||||
# add pypy3 to PATH by default
|
|
||||||
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 /usr/local/bin/pypy3
|
|
||||||
# pypy3 will be the python in PATH when its tools cache directory is prepended to PATH
|
|
||||||
# PEP 394-style symlinking; don't bother with minor version
|
|
||||||
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python3
|
|
||||||
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python3 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python
|
|
||||||
|
|
||||||
# Install latest Pip for PyPy3
|
|
||||||
$AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 -m ensurepip
|
|
||||||
$AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 -m pip install --ignore-installed pip
|
|
||||||
|
|
||||||
# Run tests to determine that the software installed as expected
|
# Run tests to determine that the software installed as expected
|
||||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||||
for cmd in python pip pypy python3 pip3 pypy3; do
|
for cmd in python python3; do
|
||||||
if ! command -v $cmd; then
|
if ! command -v $cmd; then
|
||||||
echo "$cmd was not installed or not found on PATH"
|
echo "$cmd was not installed or not found on PATH"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -60,8 +22,4 @@ done
|
|||||||
# Document what was added to the image
|
# Document what was added to the image
|
||||||
echo "Lastly, documenting what we added to the metadata file"
|
echo "Lastly, documenting what we added to the metadata file"
|
||||||
DocumentInstalledItem "Python ($(python --version 2>&1))"
|
DocumentInstalledItem "Python ($(python --version 2>&1))"
|
||||||
DocumentInstalledItem "pip ($(pip --version))"
|
|
||||||
DocumentInstalledItem "Python3 ($(python3 --version))"
|
DocumentInstalledItem "Python3 ($(python3 --version))"
|
||||||
DocumentInstalledItem "pip3 ($(pip3 --version))"
|
|
||||||
DocumentInstalledItem "PyPy2 ($(pypy --version 2>&1 | grep PyPy))"
|
|
||||||
DocumentInstalledItem "PyPy3 ($(pypy3 --version 2>&1 | grep PyPy))"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user