From acd1ec757afda3e6f5e4907c3dc92aa7765563f1 Mon Sep 17 00:00:00 2001 From: Pavel Zeman Date: Fri, 20 Mar 2026 01:39:58 +0000 Subject: [PATCH] ci: cache prepackaged plugins in mmctl tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cache the prepackaged_plugins directory between mmctl test runs using actions/cache. The cache key is derived from a SHA-256 hash of the PLUGIN_PACKAGES lines in server/Makefile, so the cache automatically invalidates whenever any plugin version is bumped — no manual key updates needed. Uses actions/cache output (cache-hit) to skip the download step entirely on cache hits. Saves ~1-2 minutes per mmctl test run by avoiding repeated plugin downloads. Co-authored-by: Claude --- .github/workflows/mmctl-test-template.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/mmctl-test-template.yml b/.github/workflows/mmctl-test-template.yml index ba674867b06..c606ed1bc10 100644 --- a/.github/workflows/mmctl-test-template.yml +++ b/.github/workflows/mmctl-test-template.yml @@ -54,7 +54,23 @@ jobs: run: | echo "${{ inputs.name }}" > server/test-name echo "${{ github.event.pull_request.number }}" > server/pr-number + - name: Compute plugin cache key + id: plugin-cache-key + run: | + # Extract PLUGIN_PACKAGES lines from Makefile to derive a stable cache key. + # Cache auto-invalidates whenever any plugin version changes in the Makefile. + PLUGIN_HASH=$(grep '^PLUGIN_PACKAGES' server/Makefile | sha256sum | cut -d' ' -f1) + echo "hash=$PLUGIN_HASH" >> "$GITHUB_OUTPUT" + + - name: Cache prepackaged plugins + id: plugin-cache + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + with: + path: server/prepackaged_plugins + key: prepackaged-plugins-${{ steps.plugin-cache-key.outputs.hash }} + - name: Setup needed prepackaged plugins + if: steps.plugin-cache.outputs.cache-hit != 'true' run: | cd server make prepackaged-plugins PLUGIN_PACKAGES=mattermost-plugin-jira-v3.2.5