Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve charmcraft's package cache between builds #94

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ jobs:
- name: Check out repo
uses: actions/checkout@v4

- name: Setup Charmcraft's pip 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:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading