Skip to content

Commit 531bc88

Browse files
committed
add swift version to spm cache
1 parent 714b212 commit 531bc88

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.github/workflows/benchmark-pr.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ jobs:
3131
with:
3232
aws-region: us-east-2
3333

34+
- name: Get Swift Version
35+
id: swift-version
36+
run: echo "version=$(swift --version 2>&1 | grep -oE 'Swift version [0-9.]+' | grep -oE '[0-9.]+')" >> $GITHUB_OUTPUT
37+
3438
- name: Cache SPM
3539
uses: runs-on/cache@v4
3640
with:
3741
path: '**/.build'
38-
key: ${{ runner.os }}-spm-release-${{ hashFiles('**/Package.resolved') }}
42+
key: ${{ runner.os }}-spm-release-swift-${{ steps.swift-version.outputs.version }}-${{ hashFiles('**/Package.resolved') }}
3943
restore-keys: |
40-
${{ runner.os }}-spm-release-
44+
${{ runner.os }}-spm-release-swift-${{ steps.swift-version.outputs.version }}-
4145
env:
4246
RUNS_ON_S3_BUCKET_CACHE: laminar-gh-action-cache
4347

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ jobs:
4444
- uses: aws-actions/configure-aws-credentials@v4
4545
with:
4646
aws-region: us-east-2
47+
- name: Get Swift Version
48+
id: swift-version
49+
run: echo "version=$(swift --version 2>&1 | grep -oE 'Swift version [0-9.]+' | grep -oE '[0-9.]+')" >> $GITHUB_OUTPUT
4750
- name: Cache SPM
4851
uses: runs-on/cache@v4
4952
with:
5053
path: '**/.build'
51-
key: ${{ runner.os }}-spm-${{ matrix.config }}-${{ hashFiles('**/Package.resolved') }}
54+
key: ${{ runner.os }}-spm-${{ matrix.config }}-swift-${{ steps.swift-version.outputs.version }}-${{ hashFiles('**/Package.resolved') }}
5255
restore-keys: |
53-
${{ runner.os }}-spm-${{ matrix.config }}-
56+
${{ runner.os }}-spm-${{ matrix.config }}-swift-${{ steps.swift-version.outputs.version }}-
5457
env:
5558
RUNS_ON_S3_BUCKET_CACHE: laminar-gh-action-cache
5659
- name: Cache Cargo

.github/workflows/coverage.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ jobs:
3030
- uses: aws-actions/configure-aws-credentials@v4
3131
with:
3232
aws-region: us-east-2
33+
- name: Get Swift Version
34+
id: swift-version
35+
run: echo "version=$(swift --version 2>&1 | grep -oE 'Swift version [0-9.]+' | grep -oE '[0-9.]+')" >> $GITHUB_OUTPUT
3336
- name: Cache SPM
3437
uses: runs-on/cache@v4
3538
with:
3639
path: '**/.build'
37-
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
40+
key: ${{ runner.os }}-spm-swift-${{ steps.swift-version.outputs.version }}-${{ hashFiles('**/Package.resolved') }}
3841
restore-keys: |
39-
${{ runner.os }}-spm-
42+
${{ runner.os }}-spm-swift-${{ steps.swift-version.outputs.version }}-
4043
env:
4144
RUNS_ON_S3_BUCKET_CACHE: laminar-gh-action-cache
4245
- name: Cache Cargo

0 commit comments

Comments
 (0)