Repository: plone/plone.restapi (language: python)

Issue:
Add buildout eggs cache to Github Actions configuration
The GHA tests spend quite a long time running the buildout. It should be possible to improve this by making sure the buildout eggs eggs directory is cached between builds


Discussion / hints:

Fix patch:
diff --git a/news/1515.internal b/news/1515.internal
new file mode 100644
index 0000000000..4384aab806
--- /dev/null
+++ b/news/1515.internal
@@ -0,0 +1,1 @@
+Cache buildout eggs between Github Actions runs. [davisagli]


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index c4f6b7605a..1a36bdb40c 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -24,17 +24,19 @@ jobs:
 
       # python setup
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v1
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
+          cache: 'pip'
 
-      # python cache
-      - uses: actions/cache@v1
+      # buildout eggs cache
+      - uses: actions/cache@v3
         with:
-          path: ~/.cache/pip
-          key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+          path: eggs
+          key: ${{ runner.os }}-py${{ matrix.python-version }}-plone${{ matrix.plone-version }}-${{ hashFiles('*.cfg') }}
           restore-keys: |
-            ${{ runner.os }}-pip-
+            ${{ runner.os }}-py${{ matrix.python-version }}-plone${{ matrix.plone-version }}-
+            ${{ runner.os }}-py${{ matrix.python-version }}-
 
       # python install
       - run: pip install virtualenv
@@ -44,7 +46,7 @@ jobs:
 
       # buildout
       - name: buildout
-        run: buildout -t 10 -c plone-${{ matrix.plone-version }}.x.cfg code-analysis:return-status-codes=True
+        run: buildout -t 10 -c plone-${{ matrix.plone-version }}.x.cfg
         env:
           CI: true
 
@@ -56,8 +58,8 @@ jobs:
       - name: test
         run: bin/test
 
-      # test no uncommited changes
-      - name: test no uncommited changes
+      # test no uncommitted changes
+      - name: test no uncommitted changes
         run: ./test-no-uncommitted-doc-changes
         env:
           PYTHON_VERSION: ${{ matrix.python-version }}