-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This should hopefully show how much of a difference, if any, caching packages makes. There's no automated comparison here, the test just runs one install without a cache, then a second install with a cache, then a human needs to look at what difference it makes.
- Loading branch information
Showing
3 changed files
with
80 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Cache performance testing | ||
|
||
# Only run manually: the purpose of this test is to check how much (if at all) | ||
# using the caches helps, and that's not something that needs doing often, and | ||
# it is something that's time consuming. | ||
on: workflow_dispatch | ||
|
||
# Avoid running at the same time as other actions that interfere with caches, | ||
# to avoid pollution. | ||
concurrency: caches | ||
|
||
jobs: | ||
clear-caches: | ||
uses: ./.github/workflows/clear-caches.yml | ||
permissions: | ||
actions: write | ||
|
||
# There should now be no cache, so we can test how long it takes to do an | ||
# install without a cache while building the cache for the later action. | ||
install-without-cache: | ||
runs-on: windows-latest | ||
needs: clear-caches | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install a large set of Cygwin packages | ||
uses: ./ | ||
with: | ||
packages: > | ||
biber doxygen evolution kde-dev-utils | ||
mkvtoolnix-debuginfo nghttp x11vnc | ||
package-cache: saveonly | ||
|
||
install-with-cache: | ||
runs-on: windows-latest | ||
needs: install-without-cache | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install a large set of Cygwin packages | ||
uses: ./ | ||
with: | ||
packages: > | ||
biber doxygen evolution kde-dev-utils | ||
mkvtoolnix-debuginfo nghttp x11vnc | ||
package-cache: enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Clear Cygwin package caches | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
clear-caches: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
steps: | ||
# This will only delete up to 100 caches. That should be far more than | ||
# is ever needed. | ||
- name: Delete cache entries | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const response = await github.rest.actions.getActionsCacheList({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
per_page: 100, | ||
key: 'cygwin-install-action-packages-' | ||
}); | ||
for (const cache of response.data.actions_caches) { | ||
await github.rest.actions.deleteActionsCacheById({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
cache_id: cache.id | ||
}); | ||
} |