From 057c26710a1f1daf68c00a72180963191d49953d Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Wed, 31 Jul 2024 18:21:30 -0400 Subject: .github/request-reviews.yml: Cache PIP modules - Optimizes and makes the PIP module installation process for the workflow more robust by caching the pip modules used so the only time the workflow needs to reach to PyPi is when new PIP modules are published. - Improves long term stability by locking the major versions for PIP modules in the workflow. This is to reduce overall maintenance over time to automatically pick up new versions while also not being broken in the process. - Removes edk2-pytool-extensions as it is not used. The new "requirements.txt" file is used to lock versions and support the caching step which depends on a requirements file. Signed-off-by: Michael Kubacki --- .github/scripts/requirements.txt | 12 ++++++++++++ .github/workflows/request-reviews.yml | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .github/scripts/requirements.txt diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt new file mode 100644 index 0000000000..4b4988cc2f --- /dev/null +++ b/.github/scripts/requirements.txt @@ -0,0 +1,12 @@ +## @file +# GitHub Helpers Python PIP requirements file +# +# This file provides the list of python components used in GitHub scripts in this repository. +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +edk2-pytool-library==0.* +requests==2.* diff --git a/.github/workflows/request-reviews.yml b/.github/workflows/request-reviews.yml index a9b81c37d2..f80bb591d5 100644 --- a/.github/workflows/request-reviews.yml +++ b/.github/workflows/request-reviews.yml @@ -45,13 +45,15 @@ jobs: BaseTools/Scripts Maintainers.txt - - name: Set up Python + - name: Setup Python uses: actions/setup-python@v5 with: python-version: '3.x' + cache: 'pip' + cache-dependency-path: '.github/scripts/requirements.txt' - name: Install PIP Modules - run: pip install edk2-pytool-library edk2-pytool-extensions requests + run: pip install -r .github/scripts/requirements.txt --upgrade - name: Add Reviewers to Pull Request shell: python -- cgit v1.2.3