From 833e12a51460e843fa194da78ac7a06cf02741a5 Mon Sep 17 00:00:00 2001 From: Andrew Scribner Date: Sun, 12 May 2024 12:48:59 +0200 Subject: [PATCH 1/2] cache charmcraft's pip in integration and publish ci --- .github/workflows/integrate.yaml | 13 +++++++++++++ .github/workflows/publish.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index bc700cb..69282a9 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -51,6 +51,19 @@ jobs: - name: Check out repo uses: actions/checkout@v4 + - name: Setup Charmcraft's cache + id: cache + uses: actions/cache@v4 + with: + path: /home/runner/snap/charmcraft/common/cache/charmcraft/ + # Cache keys must be unique - there is no overwrite mechanic. Add IDs to avoid this (is there a better set of IDs?) + # partial ref: https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache + # To match the most recent previous cache, use restore-keys with the craft-shared-cache prefix. This will hit the + # "first" match, which will be from the most recent run. + # ref: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + key: craft-shared-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}-${{ strategy.job-index }} + restore-keys: craft-shared-cache + - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 966a317..57d6d3a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -83,6 +83,19 @@ jobs: echo "setting output of tag_prefix=$tag_prefix" echo "::set-output name=tag_prefix::$tag_prefix" + - name: Setup Charmcraft's cache + id: cache + uses: actions/cache@v4 + with: + path: /home/runner/snap/charmcraft/common/cache/charmcraft/ + # Cache keys must be unique - there is no overwrite mechanic. Add IDs to avoid this (is there a better set of IDs?) + # partial ref: https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache + # To match the most recent previous cache, use restore-keys with the craft-shared-cache prefix. This will hit the + # "first" match, which will be from the most recent run. + # ref: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + key: craft-shared-cache-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}-${{ strategy.job-index }} + restore-keys: craft-shared-cache + - name: Upload charm to charmhub uses: canonical/charming-actions/upload-charm@2.4.0 with: From 8f1128b1263a17674a146b69338f9af120c2479c Mon Sep 17 00:00:00 2001 From: Andrew Scribner Date: Sun, 12 May 2024 14:06:04 +0200 Subject: [PATCH 2/2] trivial change to proc CI again --- .github/workflows/integrate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 69282a9..698255c 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -51,7 +51,7 @@ jobs: - name: Check out repo uses: actions/checkout@v4 - - name: Setup Charmcraft's cache + - name: Setup Charmcraft's pip cache id: cache uses: actions/cache@v4 with: