From 5ee91c73ed17cbb49899a7d91fce9377fd6e4599 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sun, 6 Jun 2021 03:49:23 -0500
Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20caching=20to=20CI=20workfl?=
 =?UTF-8?q?ow?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .github/workflows/test-builds.yml | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml
index 979f56cb6a..97a6534f85 100644
--- a/.github/workflows/test-builds.yml
+++ b/.github/workflows/test-builds.yml
@@ -107,8 +107,25 @@ jobs:
 
     steps:
 
+    - name: Check out the PR
+      uses: actions/checkout@v2
+
+    - name: Cache pip
+      uses: actions/cache@v2
+      with:
+        path: ~/.cache/pip
+        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+        restore-keys: |
+          ${{ runner.os }}-pip-
+
+    - name: Cache PlatformIO
+      uses: actions/cache@v2
+      with:
+        path: ~/.platformio
+        key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
+
     - name: Select Python 3.7
-      uses: actions/setup-python@v1
+      uses: actions/setup-python@v2
       with:
         python-version: '3.7' # Version range or exact version of a Python version to use, using semvers version range syntax.
         architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
@@ -118,9 +135,6 @@ jobs:
         pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
         platformio update
 
-    - name: Check out the PR
-      uses: actions/checkout@v2
-
     - name: Run ${{ matrix.test-platform }} Tests
       run: |
         make tests-single-ci TEST_TARGET=${{ matrix.test-platform }}