From c98145466f823a41ae6d7baa4161686f6ff3fa08 Mon Sep 17 00:00:00 2001 From: Michael Adkins Date: Wed, 23 Nov 2022 13:46:01 -0600 Subject: [PATCH 1/2] Update `setup-python` action in tests to use new caching feature --- .github/workflows/test.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f87be700b0e6..b5d6c9508f8aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,15 +19,12 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 + id: setup-python with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v02 + cache: "pip" - name: Install Dependencies - if: steps.cache.outputs.cache-hit != 'true' + if: steps.setup-python.outputs.cache-hit != 'true' run: pip install -e .[all,dev,doc,test] - name: Lint run: bash scripts/lint.sh From 30ec2d72798b9daec7e02302b27dbc716ca78317 Mon Sep 17 00:00:00 2001 From: Michael Adkins Date: Wed, 23 Nov 2022 13:50:25 -0600 Subject: [PATCH 2/2] Add explicit `cache-dependency-path` Since FastAPI does not use a requirements.txt file, a file to generate a hash from must be provided to the action --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5d6c9508f8aa..85779af18b817 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: "pip" + cache-dependency-path: pyproject.toml - name: Install Dependencies if: steps.setup-python.outputs.cache-hit != 'true' run: pip install -e .[all,dev,doc,test]