Skip to content

Commit 350b35a

Browse files
committed
Cache Chocolatey using GStreamer version as key
1 parent 7769601 commit 350b35a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/build-workspace.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,20 @@ jobs:
7979
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.FAST_WORKSPACE }}" -Recurse
8080
8181
# Put the Chocolatey temp directory in a place where we can use the cache action to save and restore it.
82-
- name: Set chocolatey temp directory
82+
- name: Set Chocolatey temp directory
8383
run: |
8484
choco config set cacheLocation --value "D:\chocolatey_cache"
8585
echo "CHOCO_TEMP=D:\chocolatey_cache" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
8686
87+
- name: Get current GStreamer package version
88+
run: echo "GST_PACKAGE_VERSION=$(choco info -y --limit-output gstreamer)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
89+
8790
- name: Restore Chocolatey cache
8891
id: choco-cache-restore
8992
uses: actions/cache/restore@v4
9093
with:
9194
path: ${{ env.CHOCO_TEMP }}
92-
# TODO: Why did I set up the cache key like this?
93-
key: 'this should never hit'
94-
restore-keys: choco-${{ github.job }}-
95+
key: choco-${{ github.job }}-${{ env.GST_PACKAGE_VERSION }}
9596

9697
- name: Install gstreamer
9798
# Some things to note:
@@ -100,7 +101,7 @@ jobs:
100101
# seemingly chosen at random.
101102
# - We need to export said path to the environment variables so that later steps can use it.
102103
run: |
103-
choco install gstreamer gstreamer-devel
104+
choco install -y gstreamer gstreamer-devel
104105
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
105106
refreshenv
106107
echo "$($Env:GSTREAMER_1_0_ROOT_MSVC_X86_64)bin"
@@ -112,8 +113,7 @@ jobs:
112113
uses: actions/cache/save@v4
113114
with:
114115
path: ${{ env.CHOCO_TEMP }}
115-
# TODO: Pretty sure I'm misunderstanding the point of hashFiles here.
116-
key: choco-${{ github.job }}-${{ hashFiles(format('{0}\**\*', env.CHOCO_TEMP)) }}
116+
key: choco-${{ github.job }}-${{ env.GST_PACKAGE_VERSION }}
117117

118118
- uses: Swatinem/rust-cache@v2
119119
with:

0 commit comments

Comments
 (0)