From 3479a3e7cd4a9eeeceed28b2fd11a6e53555c4f6 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 8 Jun 2024 18:28:43 +0200 Subject: [PATCH] Update action.yml to cache pip dependencies --- action.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 30cedb38..b118138c 100644 --- a/action.yml +++ b/action.yml @@ -71,11 +71,17 @@ runs: ref: ${{ github.head_ref || github.ref }} fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + cache: "pip" # caching pip dependencies + - name: Install Dependencies - # tomli required for codespell with pyproject.toml + # Note tomli required for codespell with pyproject.toml if: github.event.action != 'closed' run: | - pip install --no-cache -q \ + pip install -q \ ruff docformatter codespell tomli \ mdformat-gfm mdformat-frontmatter mdformat-mkdocs shell: bash @@ -167,11 +173,10 @@ runs: OPENAI_AZURE_API_KEY: ${{ inputs.openai_azure_api_key }} OPENAI_AZURE_ENDPOINT: ${{ inputs.openai_azure_endpoint }} OPENAI_MODEL: ${{ inputs.openai_model }} + # Note file must be run remotely, not with "python utils/run_pr_summary.py" run: | - pip install --no-cache -q openai - # python utils/run_pr_summary.py - curl -o run_pr_summary.py "https://raw.githubusercontent.com/ultralytics/actions/main/utils/run_pr_summary.py" - python run_pr_summary.py + pip install -q openai + curl -s "https://raw.githubusercontent.com/ultralytics/actions/main/utils/run_pr_summary.py" | python - shell: bash continue-on-error: true