Skip to content

Commit

Permalink
Cache wheels in e2e-performance
Browse files Browse the repository at this point in the history
  • Loading branch information
pbchekin committed Mar 29, 2024
1 parent e25b88f commit 06c4c7c
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions .github/actions/install-wheels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,44 @@ inputs:
runs:
using: "composite"
steps:
- name: Get the latest run id
id: run_id
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
run: |
set -e
run_id=$(gh run list -w "${{ inputs.workflow }}" --repo ${{ inputs.repository }} --json databaseId --jq '.[0].databaseId')
if [[ ! $unr_id ]]; then
exit 1
fi
echo "${{ inputs.workflow }}: $run_id"
echo "run_id=$run_id" >> $GITHUB_OUTPUT
- name: Load wheels from cache
id: wheels-cache
uses: ./.github/actions/load
with:
path: ~/wheels
key: wheels-py${{ inputs.python_version }}-${{ steps.run_id.outputs.run_id }}

- name: Install wheels from specified workflow artifacts
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
run: |
set -x
WORKFLOW_ID=$(gh run list -w "${{ inputs.workflow }}" -R ${{ inputs.repository }} --json databaseId | jq '.[0].databaseId')
TEMP_DIR=`mktemp -d`
pushd ${TEMP_DIR}
gh run download ${WORKFLOW_ID} -R ${{ inputs.repository }} --pattern "wheels-py${{ inputs.python_version }}*"
cd wheels-py${{ inputs.python_version }}*
mkdir -p ~/wheels
gh run download ${{ steps.run_id.outputs.run_id }} \
--repo ${{ inputs.repository }} \
--pattern "wheels-py${{ inputs.python_version }}*" \
--dir ~/wheels
cd ~/wheels/wheels-py${{ inputs.python_version }}*
${{ inputs.install_cmd }} ${{ inputs.wheels_pattern }}
popd
rm -rf ${TEMP_DIR}
- name: Save wheels to cache
if: ${{ steps.wheels-cache.outputs.status == 'miss' }}
uses: ./.github/actions/save
with:
path: ${{ steps.wheels-cache.outputs.path }}
dest: ${{ steps.wheels-cache.outputs.dest }}

0 comments on commit 06c4c7c

Please sign in to comment.