* add arm as a matrix for build job * uncomment * comment * try inside pipeline * check location * another dirs * try to privide correct action path * use corrected action * use newer commit * use newer commit * use newer commit * use newer action commit * add setting * rm from pipeline, adapt action iteslf * add missing deps * enable samples and debian jobs * correct yml * correct image name * correct syntax, use self-hosted option * enable onnx runtime and c++, use newer action * enable Python and CPU Func tests * add missing deps for arm64 * increase timeout for python tests * disable some tests, add more time * skip failing tests * skip speech sample test on arm * dummy chang * skip mxnet mo on arm, run all tests * rm quotes * separate linux x86 and arm64 workflows * rm unused matrix refs, add timeouts * add skips for c++ tests and some Python tests * correct cache keys, extend timeout * skip more python tests * add more skips: for python and CPU func * extend cpu func list with skips * disable cpu func tests and python api 2.0 tests * rm disable job * styling, rm pr trigger, rm always(), rm unnecessary changes * revert * use ifs instead of comments, provide better wording for skips
68 lines
2.5 KiB
YAML
68 lines
2.5 KiB
YAML
name: 'Setup Python and pip cache'
|
|
description: 'Setups Python with the provided version and sets up the pip cache'
|
|
inputs:
|
|
version:
|
|
description: 'Python version to install'
|
|
required: true
|
|
pip-cache-path:
|
|
description: 'Path on share where the pip cache is stored'
|
|
required: false
|
|
should-setup-pip-paths:
|
|
description: 'If the action should setup `PIP_CACHE_DIR` & `PIP_INSTALL_PATH` env variables'
|
|
required: false
|
|
default: 'false'
|
|
self-hosted-runner:
|
|
description: 'If the runner is self-hosted'
|
|
required: false
|
|
default: 'true'
|
|
show-cache-info:
|
|
description: 'If the action should show the share space occupied by cache'
|
|
required: false
|
|
default: 'false'
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
|
|
- if: ${{ runner.os == 'Linux' && inputs.self-hosted-runner == 'true' }}
|
|
name: Install 'actions/setup-python@v4' dependencies
|
|
shell: bash
|
|
run: apt-get update && apt-get install -y ca-certificates software-properties-common
|
|
|
|
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
|
|
name: Setup sudo
|
|
shell: bash
|
|
run: apt-get update && apt-get install -y sudo # Needed for the deadsnakes action
|
|
|
|
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
|
|
name: Setup Python ${{ inputs.version }}
|
|
uses: akashchi/deadsnakes-action@f01521a69eee61eaca3a34440bea3ce838317846
|
|
with:
|
|
python-version: ${{ inputs.version }}
|
|
|
|
- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64') }}
|
|
name: Setup Python ${{ inputs.version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ inputs.version }}
|
|
env:
|
|
PIP_CACHE_DIR: ${{ inputs.self-hosted-runner == 'true' && inputs.pip-cache-path || '' }}
|
|
|
|
- if: ${{ inputs.should-setup-pip-paths == 'true' }}
|
|
name: Setup pip variables (cache and install path)
|
|
shell: bash
|
|
run: |
|
|
PIP_VER=$(python3 -c "import pip; print(pip.__version__)")
|
|
echo "Using pip version: ${PIP_VER}"
|
|
echo "PIP_CACHE_DIR=${{ inputs.pip-cache-path }}/${PIP_VER}" >> $GITHUB_ENV
|
|
echo "PIP_INSTALL_PATH=$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')" >> $GITHUB_ENV
|
|
|
|
- if: ${{ inputs.show-cache-info == 'true' }}
|
|
name: Get pip cache info
|
|
shell: bash
|
|
run: |
|
|
echo "Cache size: "
|
|
du -h -d2 ${{ env.PIP_CACHE_DIR }}
|
|
echo "Cache info: "
|
|
python3 -m pip cache info
|
|
continue-on-error: true
|