Skip to content

Commit

Permalink
update integration CI to preserve charmcraft's cache between builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-scribner committed May 3, 2024
1 parent def4346 commit 7644bcf
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,45 +68,45 @@ jobs:
juju-channel: 3.1/stable
charmcraft-channel: latest/candidate

- name: Setup Charmcraft's cache
id: cache
uses: actions/cache@v4
with:
path: ${{ env.CRAFT_SHARED_CACHE }}
# 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 Charmcraft's cache
id: cache
uses: actions/cache@v4
with:
path: ${{ env.CRAFT_SHARED_CACHE }}
# 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

# DEBUG: remove this
- name: emit charmcraft cache directory contents
run: |
find $CRAFT_SHARED_CACHE | wc -l
find $CRAFT_SHARED_CACHE/wheels | wc -l
# DEBUG: remove this
- name: emit charmcraft cache directory contents
run: |
find $CRAFT_SHARED_CACHE | wc -l
find $CRAFT_SHARED_CACHE/wheels | wc -l
- name: Run integration tests
run: |
juju add-model test-istio
tox -e ${{ matrix.integration-types }} -- --model test-istio
timeout-minutes: 80

# DEBUG: remove this
- name: emit charmcraft cache directory contents
run: |
find $CRAFT_SHARED_CACHE | wc -l
find $CRAFT_SHARED_CACHE/wheels | wc -l
- name: Setup Debug Artifact Collection
run: mkdir tmp
if: failure()

- name: Collect charmcraft logs
if: failure()
# DEBUG: remove this
- name: emit charmcraft cache directory contents
run: |
cat /home/runner/.local/state/charmcraft/log/charmcraft-*.log | tee tmp/charmcraft.log
find $CRAFT_SHARED_CACHE | wc -l
find $CRAFT_SHARED_CACHE/wheels | wc -l
- name: Setup Debug Artifact Collection
run: mkdir tmp
if: failure()

- name: Collect charmcraft logs
if: failure()
run: |
cat /home/runner/.local/state/charmcraft/log/charmcraft-*.log | tee tmp/charmcraft.log
- name: Collect Juju status
if: failure()
Expand Down

0 comments on commit 7644bcf

Please sign in to comment.