Skip to content

Commit 92daa79

Browse files
authored
Merge pull request #58 from ktoso/wip-more-ci-work
2 parents edee32e + 7a66a01 commit 92daa79

File tree

2 files changed

+47
-20
lines changed

2 files changed

+47
-20
lines changed

.github/workflows/pull_request.yml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,31 @@ 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'
44-
- name: Install Nightly Swift
39+
- name: Install Untested Nightly Swift
4540
run: "bash -xc './docker/install_untested_nightly_swift.sh'"
46-
# Cache .m2/repository
41+
# setup caches
4742
- name: Cache local Gradle repository
4843
uses: actions/cache@v4
4944
continue-on-error: true
5045
with:
51-
path: ~/.gradle/caches
52-
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/build.gradle.kts') }}
46+
path: |
47+
/root/.gradle/caches
48+
/root/.gradle/wrapper
49+
key: ${{ runner.os }}-gradle-${{ hashFiles('*/*.gradle*', 'settings.gradle') }}
5350
restore-keys: |
54-
${{ runner.os }}-gradle-cache
5551
${{ runner.os }}-gradle-
52+
- name: Cache local SwiftPM repository
53+
uses: actions/cache@v4
54+
continue-on-error: true
55+
with:
56+
path: /__w/swift-java/swift-java/.build/checkouts
57+
key: ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
58+
restore-keys: |
59+
${{ runner.os }}-swiftpm-cache
60+
${{ runner.os }}-swiftpm-
61+
# run the actual build
5662
- name: Gradle build
57-
run: ./gradlew build --info --no-daemon
63+
run: ./gradlew update --info --no-daemon
5864

5965
test-swift:
6066
name: Swift tests (swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}} os:${{ matrix.os_version }})
@@ -75,8 +81,29 @@ jobs:
7581
run: apt-get -qq update && apt-get -qq install -y make curl wget
7682
- name: Install JDK
7783
run: "bash -xc 'JDK_VENDOR=${{ matrix.jdk_vendor }} ./docker/install_jdk.sh'"
78-
- name: Install Nightly Swift
84+
- name: Install Untested Nightly Swift
7985
run: "bash -xc './docker/install_untested_nightly_swift.sh'"
86+
# setup caches
87+
- name: Cache local Gradle repository
88+
uses: actions/cache@v4
89+
continue-on-error: true
90+
with:
91+
path: |
92+
/root/.gradle/caches
93+
/root/.gradle/wrapper
94+
key: ${{ runner.os }}-gradle-${{ hashFiles('*/*.gradle*', 'settings.gradle') }}
95+
restore-keys: |
96+
${{ runner.os }}-gradle-
97+
- name: Cache local SwiftPM repository
98+
uses: actions/cache@v4
99+
continue-on-error: true
100+
with:
101+
path: /__w/swift-java/swift-java/.build/checkouts
102+
key: ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
103+
restore-keys: |
104+
${{ runner.os }}-swiftpm-cache
105+
${{ runner.os }}-swiftpm-
106+
# run the actual build
80107
- name: Generate sources (make) (Temporary)
81108
# TODO: this should be triggered by the respective builds
82109
run: "make jextract-run"

docker/install_untested_nightly_swift.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ if [[ "$(grep "22.04" /etc/lsb-release)" = "" ]]; then
2424
fi
2525

2626
UNTESTED_TOOLCHAIN_URL=$(curl -s $SWIFT_UNTESTED_TOOLCHAIN_JOB_URL | grep 'Toolchain: ' | sed 's/Toolchain: //g')
27-
UNTESTED_TOOLCHAIN_FILENAME=$(echo "$UNTESTED_TOOLCHAIN_URL" | awk '
28-
function basename(file) {
29-
sub(".*/", "", file)
30-
return file
31-
}
32-
{print FILENAME, basename(FILENAME)}')
27+
UNTESTED_TOOLCHAIN_FILENAME=$"toolchain.tar.gz"
28+
29+
echo "Download toolchain: $UNTESTED_TOOLCHAIN_URL"
3330

3431
cd /
35-
curl "$UNTESTED_TOOLCHAIN_URL" > "$UNTESTED_TOOLCHAIN_FILENAME"
32+
curl -s "$UNTESTED_TOOLCHAIN_URL" > "$UNTESTED_TOOLCHAIN_FILENAME"
33+
34+
swift -version
3635

36+
echo "Extract toolchain: $UNTESTED_TOOLCHAIN_FILENAME"
3737
tar xzf "$UNTESTED_TOOLCHAIN_FILENAME"
38-
swift -version
38+
swift -version

0 commit comments

Comments
 (0)