Skip to content

Commit

Permalink
test ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinaPieri committed Aug 11, 2023
1 parent b5ec080 commit 1661642
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ jobs:
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=main
echo "Fetching list of cache key"
cacheKey=${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
cache_delete=$(gh actions-cache delete $cacheKey -R $REPO --confirm | grep "Deleted 1 cache entry with key")
echo $cache_delete
[[ -z "$cache_delete" ]] && exit 1 || echo "Cache Delete Successful"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
echo cacheKeysForPR
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1661642

Please sign in to comment.