Skip to content

Commit 15e62b9

Browse files
committed
Github workflow: add wxWidgets source code to the cache of workflow
1 parent 48196fd commit 15e62b9

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/build-linux.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Generate cache key
6363
id: cache-key
6464
run: |
65-
echo "cache_key=$(echo ${{ env.WXWIDGETS_VERSION }}-$(sha256sum src/Makefile | awk '{print $1}'))" >> $GITHUB_OUTPUT
65+
echo "cache_key=$(echo ${{ env.WXWIDGETS_VERSION }}-$(sha256sum src/Makefile .github/workflows/build-linux.yml | awk '{print $1}'))" >> $GITHUB_OUTPUT
6666
6767
- name: Cache wxBuildConsole
6868
uses: actions/cache@v3
@@ -78,11 +78,18 @@ jobs:
7878
path: /tmp/wxBuildGUI
7979
key: wxBuildGUI-${{ steps.cache-key.outputs.cache_key }}
8080

81+
- name: Cache wxWidgets
82+
uses: actions/cache@v3
83+
id: cache-wxwidgets
84+
with:
85+
path: /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }}
86+
key: wxWidgets-${{ steps.cache-key.outputs.cache_key }}
87+
8188
- name: Install dependencies
82-
run: sudo apt-get update && sudo apt-get install -y wget tar libpcsclite-dev libfuse-dev yasm libgtk-3-dev libwxgtk3.0-gtk3-dev libayatana-appindicator3-dev cmake debhelper
89+
run: sudo apt-get update && sudo apt-get install -y wget tar libpcsclite-dev libfuse-dev yasm libgtk-3-dev libayatana-appindicator3-dev cmake debhelper
8390

8491
- name: Download and extract wxWidgets to /tmp if build folders are missing
85-
if: steps.cache-wxbuildconsole.outputs.cache-hit != 'true' || steps.cache-wxbuildgui.outputs.cache-hit != 'true'
92+
if: steps.cache-wxbuildconsole.outputs.cache-hit != 'true' || steps.cache-wxbuildgui.outputs.cache-hit != 'true' || steps.cache-wxwidgets.outputs.cache-hit != 'true'
8693
run: |
8794
wget https://github.com/wxWidgets/wxWidgets/releases/download/v${{ env.WXWIDGETS_VERSION }}/wxWidgets-${{ env.WXWIDGETS_VERSION }}.tar.bz2 -O /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }}.tar.bz2
8895
mkdir -p /tmp/wxWidgets-${{ env.WXWIDGETS_VERSION }}
@@ -183,15 +190,17 @@ jobs:
183190
uses: actions/github-script@v6
184191
if: always()
185192
with:
193+
github-token: ${{ secrets.WORKFLOW_TOKEN }}
186194
script: |
187195
const caches = await github.rest.actions.getActionsCacheList({
188196
owner: context.repo.owner,
189197
repo: context.repo.repo,
190198
})
191199
for (const cache of caches.data.actions_caches) {
192-
if (cache.key.startsWith('wxBuildConsole-') || cache.key.startsWith('wxBuildGUI-')) {
200+
if (cache.key.startsWith('wxBuildConsole-') || cache.key.startsWith('wxBuildGUI-') || cache.key.startsWith('wxWidgets-')) {
193201
if (cache.key !== `wxBuildConsole-${{ steps.cache-key.outputs.cache_key }}` &&
194-
cache.key !== `wxBuildGUI-${{ steps.cache-key.outputs.cache_key }}`) {
202+
cache.key !== `wxBuildGUI-${{ steps.cache-key.outputs.cache_key }}` &&
203+
cache.key !== `wxWidgets-${{ steps.cache-key.outputs.cache_key }}`) {
195204
console.log(`Deleting cache with key: ${cache.key}`)
196205
await github.rest.actions.deleteActionsCacheById({
197206
owner: context.repo.owner,

0 commit comments

Comments
 (0)