Skip to content

Commit

Permalink
remove more caches
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckh committed Feb 7, 2023
1 parent 2163354 commit 3694c1b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/run-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ jobs:
"$next" >> "$2"
next=$(egrep -i '^link: ' "$2.headers" | grep -P -i -o '(?<=<)([\S]*)(?=>; rel="next")') || [[ $? == 1 ]]
done
if [[ $RUNNER_DEBUG -eq 1 ]]; then
echo "::group::$1"
cat "$2"
echo "::endgroup::"
fi
}
stamp=$(jq -n -r 'now')
Expand All @@ -606,18 +611,9 @@ jobs:
jq -r '.[] | .number | "refs/pull/" + (. | tostring) + "/merge" | @json' pulls.json >> branch-names.json
if [[ $RUNNER_DEBUG -eq 1 ]]; then
echo "::group::$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/git/matching-refs/heads"
cat branches.json
echo "::endgroup::"
echo "::group::$GITHUB_API_URL/repos/$GITHUB_REPOSITORY//pulls?state=open"
cat pulls.json
echo "::endgroup::"
echo "::group::$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches"
cat caches.json
echo "::endgroup::"
echo "::group::Active Branches"
cat branch-names.json
echo "::endgroup::"
echo "::group::Active Branches"
cat branch-names.json
echo "::endgroup::"
fi
jq -r --slurpfile branches branch-names.json --argjson stamp "$stamp" '
Expand Down Expand Up @@ -688,18 +684,18 @@ jobs:
fi
jq -r -s --argjson stamp "$stamp" '
{ "cmake-utils": 1, "source": 1, "tools": 2, "vcpkg-registries": 1, "vcpkg_installed": 2 } as $keep |
{ "tools": 2, "vcpkg_installed": 2 } as $keep |
[
.[]
| .actions_caches
| .[]
| (. + {"$cache": .key
| match("^cmu-(cmake-utils|source|tools|vcpkg-registries|vcpkg_installed)-")
| match("^((?<=cmu-)(?:cmake-utils|source|tools|vcpkg-registries|vcpkg_installed)|codacy-clang-tidy|opencppcoverage)-")
| .captures[0].string })
]
| group_by(."$cache")
| map(. |= ( sort_by(.last_accessed_at)
| .[:-$keep[.[0]."$cache"]]
| .[:-$keep[.[0]."$cache" // 1]]
| map( (.created_at |= (sub("\\.\\d+Z$"; "Z") | fromdateiso8601))
| select(.created_at <= $stamp)
| (.last_accessed_at |= (sub("\\.\\d+Z$"; "Z") | fromdateiso8601))
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,18 +420,18 @@ jobs:
fi
jq -r -s --argjson stamp "$stamp" '
{ "cmake-utils": 1, "source": 1, "tools": 2, "vcpkg-registries": 1, "vcpkg_installed": 2 } as $keep |
{ "tools": 2, "vcpkg_installed": 2 } as $keep |
[
.[]
| .actions_caches
| .[]
| (. + {"$cache": .key
| match("^cmu-(cmake-utils|source|tools|vcpkg-registries|vcpkg_installed)-")
| match("^((?<=cmu-)(?:cmake-utils|source|tools|vcpkg-registries|vcpkg_installed)|codacy-clang-tidy|opencppcoverage)-")
| .captures[0].string })
]
| group_by(."$cache")
| map(. |= ( sort_by(.last_accessed_at)
| .[:-$keep[.[0]."$cache"]]
| .[:-$keep[.[0]."$cache" // 1]]
| map( (.created_at |= (sub("\\.\\d+Z$"; "Z") | fromdateiso8601))
| select(.created_at <= $stamp)
| (.last_accessed_at |= (sub("\\.\\d+Z$"; "Z") | fromdateiso8601))
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,18 @@ jobs:
fi
jq -r -s --argjson stamp "$stamp" '
{ "cmake-utils": 1, "source": 1, "tools": 2, "vcpkg-registries": 1, "vcpkg_installed": 2 } as $keep |
{ "tools": 2, "vcpkg_installed": 2 } as $keep |
[
.[]
| .actions_caches
| .[]
| (. + {"$cache": .key
| match("^cmu-(cmake-utils|source|tools|vcpkg-registries|vcpkg_installed)-")
| match("^((?<=cmu-)(?:cmake-utils|source|tools|vcpkg-registries|vcpkg_installed)|codacy-clang-tidy|opencppcoverage)-")
| .captures[0].string })
]
| group_by(."$cache")
| map(. |= ( sort_by(.last_accessed_at)
| .[:-$keep[.[0]."$cache"]]
| .[:-$keep[.[0]."$cache" // 1]]
| map( (.created_at |= (sub("\\.\\d+Z$"; "Z") | fromdateiso8601))
| select(.created_at <= $stamp)
| (.last_accessed_at |= (sub("\\.\\d+Z$"; "Z") | fromdateiso8601))
Expand Down

0 comments on commit 3694c1b

Please sign in to comment.