Add proguard docs #1780
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pull_request | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| soundness: | |
| uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main | |
| with: | |
| # Not API stable package (yet) | |
| api_breakage_check_enabled: false | |
| format_check_enabled: true | |
| license_header_check_project_name: Swift.org | |
| # Since we need JAVA_HOME to be set up for building the project and depending on a different workflow won't | |
| # give us that, we disable the checking and make a separate job that performs docs validation | |
| docs_check_enabled: false | |
| # This replicates 'docs-check' from https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/soundness.yml | |
| # because we need to set up environment so we can build the SwiftJava project (including Java runtime/dependencies). | |
| soundness-docs: | |
| name: Documentation check | |
| runs-on: ubuntu-latest | |
| container: | |
| image: 'swift:6.3-noble' | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Cache .build | |
| uses: ./.github/actions/cache_swiftpm_build | |
| with: | |
| path: .build | |
| tag: docs | |
| swift-version: ${{ matrix.swift_version }} | |
| os-version: ${{ matrix.os_version }} | |
| hash-files: | | |
| Package.swift | |
| Package.resolved | |
| Sources/**/*.swift | |
| Plugins/**/*.swift | |
| - name: Swift Build | |
| run: swift build | |
| - name: Run documentation check | |
| run: ./.github/scripts/validate_docs.sh | |
| test-java: | |
| name: Test (Java) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: ubuntu-latest | |
| # Nightly builds are best-effort | |
| continue-on-error: ${{ contains(matrix.swift_version, 'nightly') }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| swift_version: ['6.3', 'nightly'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| container: | |
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | |
| env: | |
| SWIFT_JAVA_VERBOSE: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Gradle :SwiftKitCore:build | |
| run: ./gradlew :SwiftKitCore:build -x test | |
| - name: Gradle :SwiftKitCore:check | |
| run: ./gradlew :SwiftKitCore:check --info | |
| - name: Gradle :SwiftKitFFM:build | |
| run: ./gradlew :SwiftKitFFM:build -x test | |
| - name: Gradle :SwiftKitFFM:check | |
| run: ./gradlew :SwiftKitFFM:check --info | |
| test-java-macos: | |
| name: Test (Java) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: [self-hosted, macos, tahoe, ARM64] | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['macos'] | |
| jdk_vendor: ['corretto'] | |
| env: | |
| SWIFT_JAVA_VERBOSE: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Gradle :SwiftKitCore:build | |
| run: ./gradlew :SwiftKitCore:build -x test | |
| - name: Gradle :SwiftKitCore:check | |
| run: ./gradlew :SwiftKitCore:check --debug | |
| - name: Gradle :SwiftKitFFM:build | |
| run: ./gradlew :SwiftKitFFM:build -x test | |
| - name: Gradle :SwiftKitFFM:check | |
| run: ./gradlew :SwiftKitFFM:check --debug | |
| benchmark-java: | |
| name: Benchmark (JMH) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| container: | |
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | |
| env: | |
| SWIFT_JAVA_VERBOSE: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Gradle compile JMH benchmarks | |
| run: ./gradlew compileJmh --info | |
| benchmark-swift: | |
| name: Benchmark (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| container: | |
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | |
| env: | |
| SWIFT_JAVA_VERBOSE: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Install jemalloc | |
| run: apt-get update && apt-get install -y libjemalloc-dev | |
| - name: Cache Benchmarks/.build | |
| uses: ./.github/actions/cache_swiftpm_build | |
| with: | |
| path: Benchmarks/.build | |
| tag: benchmarks | |
| swift-version: ${{ matrix.swift_version }} | |
| os-version: ${{ matrix.os_version }} | |
| hash-files: | | |
| Benchmarks/Package.swift | |
| Benchmarks/Package.resolved | |
| Benchmarks/Benchmarks/**/*.swift | |
| Benchmarks/Sources/**/*.swift | |
| - name: Swift Benchmarks | |
| run: swift package --package-path Benchmarks/ benchmark | |
| test-swift: | |
| name: Test (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: ubuntu-latest | |
| # Nightly builds are best-effort | |
| continue-on-error: ${{ contains(matrix.swift_version, 'nightly') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift_version: ['6.1.3', '6.3', 'nightly'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| container: | |
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | |
| env: | |
| SWIFT_JAVA_VERBOSE: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Cache .build | |
| uses: ./.github/actions/cache_swiftpm_build | |
| with: | |
| path: .build | |
| tag: test | |
| swift-version: ${{ matrix.swift_version }} | |
| os-version: ${{ matrix.os_version }} | |
| hash-files: | | |
| Package.swift | |
| Package.resolved | |
| Sources/**/*.swift | |
| Plugins/**/*.swift | |
| Tests/**/*.swift | |
| - name: Swift Build | |
| run: swift build --build-tests --disable-sandbox --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418 | |
| - name: Swift Test (XCTest) | |
| run: swift test --disable-experimental-swift-testing --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418 | |
| - name: Swift Test (swift-testing) | |
| run: swift test --disable-xctest --disable-experimental-prebuilts # FIXME: until prebuilt swift-syntax isn't broken on 6.2 anymore: https://github.com/swiftlang/swift-java/issues/418 | |
| test-swift-macos: | |
| name: Test (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: [self-hosted, macos, tahoe, ARM64] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['macos'] | |
| jdk_vendor: ['corretto'] | |
| env: | |
| SWIFT_JAVA_VERBOSE: true | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Install Swiftly | |
| run: ./.github/scripts/install_swiftly.sh | |
| env: | |
| SWIFT_VERSION: "${{ matrix.swift_version }}" | |
| - name: Swift Build | |
| run: "swift build --build-tests --disable-sandbox" | |
| - name: Swift Test (swift-testing) | |
| run: swift test --disable-xctest | |
| - name: Swift Test (XCTest) | |
| run: swift test --disable-experimental-swift-testing | |
| build-swift-android: | |
| name: Sample SwiftJavaExtractJNISampleApp (Android) (swift:${{ matrix.swift_version }} android:${{matrix.sdk_triple}} NDK:${{matrix.ndk_version}}) | |
| runs-on: ubuntu-22.04 | |
| # Nightly builds are best-effort | |
| continue-on-error: ${{ contains(matrix.swift_version, 'nightly') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| sdk_triple: ['aarch64-unknown-linux-android28', 'x86_64-unknown-linux-android28', 'armv7-unknown-linux-android28'] | |
| ndk_version: ['r27d', 'r28c'] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Install Swift SDK for Android and build | |
| run: | | |
| apt-get -q update && apt-get -yq install curl | |
| cd Samples/SwiftJavaExtractJNISampleApp | |
| curl -L -O --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | |
| perl -pi -e "s#(download_and_extract_toolchain \".ANDROID_SDK_TAG\"\))#\1\n PATH=\\\$(dirname \\\$SWIFT_EXECUTABLE_FOR_ANDROID_SDK):\\\$PATH\n echo \"path is now \\\$PATH\"#" install-and-build-with-sdk.sh | |
| chmod 500 install-and-build-with-sdk.sh | |
| ./install-and-build-with-sdk.sh --android --build-command="swift build" --android-sdk-triple="${{ matrix.sdk_triple }}" --android-ndk-version="${{ matrix.ndk_version }}" ${{ matrix.swift_version }} | |
| verify-samples: | |
| name: Sample ${{ matrix.sample_app }} (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: ubuntu-latest | |
| # Nightly builds are best-effort | |
| continue-on-error: ${{ contains(matrix.swift_version, 'nightly') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift_version: ['6.3'] | |
| os_version: ['noble'] | |
| jdk_vendor: ['corretto'] | |
| sample_app: [ # TODO: use a reusable-workflow to generate those names | |
| 'JavaDependencySampleApp', | |
| 'JavaKitSampleApp', | |
| 'JavaProbablyPrime', | |
| 'JavaSieve', | |
| 'SwiftAndJavaJarFFMSampleLib', | |
| 'SwiftJavaExtractFFMSampleApp', | |
| 'SwiftJavaExtractJNISampleApp', | |
| ] | |
| container: | |
| image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Cache sample .build | |
| uses: actions/cache@v6 | |
| continue-on-error: true | |
| with: | |
| path: Samples/${{ matrix.sample_app }}/.build | |
| key: ${{ runner.os }}-swift${{ matrix.swift_version }}-sample-${{ matrix.sample_app }}-${{ hashFiles('Sources/**/*.swift', 'Plugins/**/*.swift', 'Package.swift', 'Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift${{ matrix.swift_version }}-sample-${{ matrix.sample_app }}- | |
| ${{ runner.os }}-swift${{ matrix.swift_version }}-sample- | |
| - name: "Verify sample: ${{ matrix.sample_app }}" | |
| run: .github/scripts/validate_sample.sh Samples/${{ matrix.sample_app }} | |
| verify-samples-macos: | |
| name: Sample ${{ matrix.sample_app }} (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}}) | |
| runs-on: [self-hosted, macos, tahoe, ARM64] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| swift_version: ['6.3'] # no nightly testing on macOS | |
| os_version: ['macos'] | |
| jdk_vendor: ['corretto'] | |
| sample_app: [ # TODO: use a reusable-workflow to generate those names | |
| 'JavaDependencySampleApp', | |
| 'JavaKitSampleApp', | |
| 'JavaProbablyPrime', | |
| 'JavaSieve', | |
| 'SwiftAndJavaJarFFMSampleLib', | |
| 'SwiftJavaExtractFFMSampleApp', | |
| 'SwiftJavaExtractJNISampleApp', | |
| ] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Install Swiftly # we specifically install Swiftly in macOS jobs because we want a simpler way to find the right dylib paths for libraries | |
| run: ./.github/scripts/install_swiftly.sh | |
| env: | |
| SWIFT_VERSION: "${{ matrix.swift_version }}" | |
| - name: Cache sample .build | |
| uses: actions/cache@v6 | |
| continue-on-error: true | |
| with: | |
| path: Samples/${{ matrix.sample_app }}/.build | |
| key: ${{ runner.os }}-swift${{ matrix.swift_version }}-sample-${{ matrix.sample_app }}-${{ hashFiles('Sources/**/*.swift', 'Plugins/**/*.swift', 'Package.swift', 'Package.resolved') }} | |
| restore-keys: | | |
| ${{ runner.os }}-swift${{ matrix.swift_version }}-sample-${{ matrix.sample_app }}- | |
| ${{ runner.os }}-swift${{ matrix.swift_version }}-sample- | |
| - name: "Verify sample ${{ matrix.sample_app }}" | |
| run: .github/scripts/validate_sample.sh Samples/${{ matrix.sample_app }} | |
| linkage-test: | |
| name: Linkage test (noble swift:6.3) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| jdk_vendor: ['corretto'] | |
| container: | |
| image: swift:6.3-noble | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install jq | |
| shell: bash | |
| run: | | |
| apt-get update -qq | |
| apt-get install -qq -y jq | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Cache Tests/LinkageTest/.build | |
| uses: ./.github/actions/cache_swiftpm_build | |
| with: | |
| path: Tests/LinkageTest/.build | |
| tag: linkage | |
| swift-version: '6.3' | |
| os-version: noble | |
| hash-files: | | |
| Tests/LinkageTest/Package.swift | |
| Tests/LinkageTest/Package.resolved | |
| Tests/LinkageTest/Sources/**/*.swift | |
| - name: Run linkage test | |
| run: ./scripts/run-linkage-test.sh | |
| env: | |
| JAVA_HOME: ${{ env.JAVA_HOME }} | |
| verify-wrap-java-idempotent: | |
| name: JavaStdlib wrap-java up-to-date | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| jdk_vendor: ['corretto'] | |
| container: | |
| image: swift:6.3-noble | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Mark workspace as safe for git | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Prepare CI Environment | |
| uses: ./.github/actions/prepare_env | |
| - name: Cache .build | |
| uses: ./.github/actions/cache_swiftpm_build | |
| with: | |
| path: .build | |
| tag: wrapjava | |
| swift-version: '6.3' | |
| os-version: noble | |
| hash-files: | | |
| Package.swift | |
| Package.resolved | |
| Sources/SwiftJavaTool/**/*.swift | |
| Sources/SwiftJavaToolLib/**/*.swift | |
| Sources/SwiftJava/**/*.swift | |
| - name: Regenerate JavaStdlib wrappers | |
| env: | |
| JAVA_HOME: ${{ env.JAVA_HOME_25 }} | |
| run: ./scripts/wrap-java-generate.sh | |
| - name: Verify no changes (whitespace-tolerant) | |
| run: | | |
| if ! git diff --ignore-all-space --ignore-blank-lines --exit-code -- '**/generated/*.swift'; then | |
| echo "::error::wrap-java output drifted. Re-run ./scripts/wrap-java-generate.sh and commit the result." | |
| git diff --ignore-all-space --ignore-blank-lines -- '**/generated/*.swift' | |
| exit 1 | |
| fi |