Skip to content

Commit b950ce1

Browse files
committed
cache downloaded swiftpm artifacts
1 parent edee32e commit b950ce1

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

.github/workflows/pull_request.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,8 @@ jobs:
3636
- name: Install JDK
3737
run: "bash -xc 'JDK_VENDOR=${{ matrix.jdk_vendor }} ./docker/install_jdk.sh'"
3838
# TODO: not using setup-java since incompatible with the swiftlang/swift base image
39-
# - uses: actions/setup-java@v4
40-
# with:
41-
# distribution: 'zulu'
42-
# java-version: '22'
43-
# cache: 'gradle'
4439
- name: Install Nightly Swift
4540
run: "bash -xc './docker/install_untested_nightly_swift.sh'"
46-
# Cache .m2/repository
4741
- name: Cache local Gradle repository
4842
uses: actions/cache@v4
4943
continue-on-error: true
@@ -53,6 +47,15 @@ jobs:
5347
restore-keys: |
5448
${{ runner.os }}-gradle-cache
5549
${{ runner.os }}-gradle-
50+
- name: Cache local SwiftPM repository
51+
uses: actions/cache@v4
52+
continue-on-error: true
53+
with:
54+
path: ~/.swiftpm/cache
55+
key: ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
56+
restore-keys: |
57+
${{ runner.os }}-swiftpm-cache
58+
${{ runner.os }}-swiftpm-
5659
- name: Gradle build
5760
run: ./gradlew build --info --no-daemon
5861

@@ -77,6 +80,15 @@ jobs:
7780
run: "bash -xc 'JDK_VENDOR=${{ matrix.jdk_vendor }} ./docker/install_jdk.sh'"
7881
- name: Install Nightly Swift
7982
run: "bash -xc './docker/install_untested_nightly_swift.sh'"
83+
- name: Cache local SwiftPM repository
84+
uses: actions/cache@v4
85+
continue-on-error: true
86+
with:
87+
path: ~/.gradle/cache
88+
key: ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
89+
restore-keys: |
90+
${{ runner.os }}-swiftpm-cache
91+
${{ runner.os }}-swiftpm-
8092
- name: Generate sources (make) (Temporary)
8193
# TODO: this should be triggered by the respective builds
8294
run: "make jextract-run"

docker/install_untested_nightly_swift.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ UNTESTED_TOOLCHAIN_FILENAME=$(echo "$UNTESTED_TOOLCHAIN_URL" | awk '
3131
}
3232
{print FILENAME, basename(FILENAME)}')
3333

34+
echo "Download toolchain: $UNTESTED_TOOLCHAIN_URL"
35+
3436
cd /
35-
curl "$UNTESTED_TOOLCHAIN_URL" > "$UNTESTED_TOOLCHAIN_FILENAME"
37+
curl -s "$UNTESTED_TOOLCHAIN_URL" > "$UNTESTED_TOOLCHAIN_FILENAME"
3638

39+
echo "Extract toolchain: $UNTESTED_TOOLCHAIN_FILENAME"
3740
tar xzf "$UNTESTED_TOOLCHAIN_FILENAME"
3841
swift -version

0 commit comments

Comments
 (0)