Skip to content

Commit

Permalink
patch(build_charms_with_cache.yaml): Only export containers if saving…
Browse files Browse the repository at this point in the history
… cache (#52)

Saves ~1 min on runs that do not save cache
  • Loading branch information
carlcsaposs-canonical authored Jun 22, 2023
1 parent d54bd9b commit 73e1da6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build_charms_with_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ jobs:
.empty
if-no-files-found: error
- name: Export `charmcraft pack` containers to cache
id: export-containers
if: ${{ !steps.restore-cache.outputs.cache-hit || github.event_name == 'schedule' }}
run: |
mkdir -p ~/ga-charmcraft-cache
charm_repository_directory_inode=$(stat --format "%i" "${{ matrix.charm.directory_path }}")
Expand Down Expand Up @@ -188,7 +190,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save cache of `charmcraft pack` LXC instance
if: ${{ !steps.restore-cache.outputs.cache-hit || github.event_name == 'schedule' }}
if: ${{ steps.export-containers.outcome == 'success' }}
uses: actions/cache/save@v3
with:
path: ~/ga-charmcraft-cache/**
Expand Down

0 comments on commit 73e1da6

Please sign in to comment.