File tree Expand file tree Collapse file tree 5 files changed +70
-44
lines changed Expand file tree Collapse file tree 5 files changed +70
-44
lines changed Original file line number Diff line number Diff line change 1+ name : ' Swift Java CI Env'
2+ description : ' Prepare the CI environment by installing Swift and selected JDK etc.'
3+
4+ runs :
5+ using : composite
6+ steps :
7+ - name : Set up JDK ${{ matrix.jdk_version }}
8+ uses : actions/setup-java@v4
9+ with :
10+ distribution : ${{ matrix.jdk_vendor }}
11+ java-version : |
12+ 24
13+ 21
14+ 17
15+ cache : ' gradle'
16+ - name : Set JAVA_HOME_{N}
17+ shell : bash
18+ run : |
19+ if [[ -n "$JAVA_HOME_21_X64" ]]; then
20+ echo "JAVA_HOME_21=$JAVA_HOME_21_X64" >> $GITHUB_ENV
21+ elif [[ -n "$JAVA_HOME_21_ARM64" ]]; then
22+ echo "JAVA_HOME_21=$JAVA_HOME_21_ARM64" >> $GITHUB_ENV
23+ fi
24+ if [[ -n "$JAVA_HOME_24_X64" ]]; then
25+ echo "JAVA_HOME_24=$JAVA_HOME_24_X64" >> $GITHUB_ENV
26+ elif [[ -n "$JAVA_HOME_24_ARM64" ]]; then
27+ echo "JAVA_HOME_24=$JAVA_HOME_24_ARM64" >> $GITHUB_ENV
28+ fi
29+ # - name: Check Java environment
30+ # shell: bash
31+ # run: ./gradlew -q javaToolchains
32+ - name : Cache local SwiftPM repository
33+ if : matrix.os_version == 'jammy'
34+ uses : actions/cache@v4
35+ continue-on-error : true
36+ with :
37+ path : /__w/swift-java/swift-java/.build/checkouts
38+ key : ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
39+ restore-keys : |
40+ ${{ runner.os }}-swiftpm-cache
41+ ${{ runner.os }}-swiftpm-
Original file line number Diff line number Diff line change 1- name : ' Swift Java CI Env '
2- description : ' Prepare the CI environment by installing Swift and selected JDK etc. '
1+ name : ' Install Swiftly '
2+ description : ' Install Swiftly '
33
44runs :
55 using : composite
66 steps :
7- - name : Set up JDK ${{ matrix.jdk_version }}
8- uses : actions/setup-java@v4
9- with :
10- distribution : ${{ matrix.jdk_vendor }}
11- java-version : |
12- 24
13- 21
14- 17
15- cache : ' gradle'
16- - name : Set JAVA_HOME_{N}
7+ - name : Set up Swiftly
178 shell : bash
18- run : |
19- if [[ -n "$JAVA_HOME_21_X64" ]]; then
20- echo "JAVA_HOME_21=$JAVA_HOME_21_X64" >> $GITHUB_ENV
21- elif [[ -n "$JAVA_HOME_21_ARM64" ]]; then
22- echo "JAVA_HOME_21=$JAVA_HOME_21_ARM64" >> $GITHUB_ENV
23- fi
24- if [[ -n "$JAVA_HOME_24_X64" ]]; then
25- echo "JAVA_HOME_24=$JAVA_HOME_24_X64" >> $GITHUB_ENV
26- elif [[ -n "$JAVA_HOME_24_ARM64" ]]; then
27- echo "JAVA_HOME_24=$JAVA_HOME_24_ARM64" >> $GITHUB_ENV
28- fi
29- # - name: Check Java environment
30- # shell: bash
31- # run: ./gradlew -q javaToolchains
32- - name : Cache local SwiftPM repository
33- if : matrix.os_version == 'jammy'
34- uses : actions/cache@v4
35- continue-on-error : true
36- with :
37- path : /__w/swift-java/swift-java/.build/checkouts
38- key : ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
39- restore-keys : |
40- ${{ runner.os }}-swiftpm-cache
41- ${{ runner.os }}-swiftpm-
9+ run : ./.github/scripts/install_swiftly.sh
Original file line number Diff line number Diff line change @@ -84,5 +84,8 @@ echo "Displaying swift version"
8484swiftly run " ${runSelector[@]} " swift --version
8585
8686if [[ " $( uname -s) " == " Linux" ]]; then
87- CC=clang swiftly run " ${runSelector[@]} " " $( dirname " $0 " ) /install-libarchive.sh"
87+ if [[ -f " $( dirname " $0 " ) /install-libarchive.sh" ]]; then
88+ CC=clang swiftly run " ${runSelector[@]} " " $( dirname " $0 " ) /install-libarchive.sh"
89+ fi
8890fi
91+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+ set -x
5+
6+ cat << EOF >> Package.swift
7+
8+ package.dependencies.append(
9+ .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0")
10+ )
11+ EOF
12+
13+ echo " Active Swift:"
14+ which swift
15+ swift -version
16+
17+ swift package plugin generate-documentation --target " SwiftJavaDocumentation" --warnings-as-errors --analyze
Original file line number Diff line number Diff line change @@ -26,21 +26,18 @@ jobs:
2626 fail-fast : true
2727 matrix :
2828 swift_version : ['6.1.2']
29+ os_version : ['jammy']
2930 jdk_vendor : ['corretto']
3031 env :
3132 ADDITIONAL_DOCC_ARGUMENTS : ' '
3233 steps :
3334 - uses : actions/checkout@v4
3435 - name : Prepare CI Environment
3536 uses : ./.github/actions/prepare_env
36- - name : Install Swiftly
37- run : ./.github/scripts/install_swiftly.sh
38- env :
39- SWIFT_VERSION : " ${{ matrix.swift_version }}"
37+ - name : Install Swiftly / Swift ${{ matrix.swift_version }}
38+ uses : ./.github/actions/install_swiftly
4039 - name : Run documentation check
41- run : |
42- which curl || (apt -q update && apt -yq install curl)
43- curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/check-docs.sh | bash
40+ run : ./github/scripts/validate_docs.sh
4441
4542 test-java :
4643 name : Test (Java) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
You can’t perform that action at this time.
0 commit comments