Skip to content

Adjust Task.immediate use so we can bring back Swift 6.1 CI until 6.2 is fixed #985

Adjust Task.immediate use so we can bring back Swift 6.1 CI until 6.2 is fixed

Adjust Task.immediate use so we can bring back Swift 6.1 CI until 6.2 is fixed #985

Workflow file for this run

name: pull_request
permissions:
contents: read
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
soundness:
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
# Not API stable package (yet)
api_breakage_check_enabled: false
# FIXME: Something is off with the format task and it gets "stuck", need to investigate
format_check_enabled: false
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.2-noble'
strategy:
fail-fast: true
matrix:
swift_version: ['6.2']
os_version: ['jammy']
jdk_vendor: ['corretto']
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- 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
strategy:
fail-fast: true
matrix:
swift_version: ['6.2', 'nightly']
os_version: ['jammy']
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@v4
- 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, sequoia, ARM64]
strategy:
fail-fast: true
matrix:
swift_version: ['6.2']
os_version: ['macos']
jdk_vendor: ['corretto']
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- 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.2']
os_version: ['jammy']
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@v4
- 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.2']
os_version: ['jammy']
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@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Install jemalloc
run: apt-get update && apt-get install -y libjemalloc-dev
- 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
strategy:
fail-fast: false
matrix:
swift_version: ['6.1.3', '6.2', 'nightly']
os_version: ['jammy']
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@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Swift Build
run: "swift build --build-tests --disable-sandbox"
- name: Swift Test
run: "swift test"
test-swift-macos:
name: Test (Swift) (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: [self-hosted, macos, sequoia, ARM64]
strategy:
fail-fast: false
matrix:
swift_version: ['6.2']
os_version: ['macos']
jdk_vendor: ['corretto']
env:
SWIFT_JAVA_VERBOSE: true
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Swift Build
run: "swift build --build-tests --disable-sandbox"
- name: Swift Test
run: "swift test"
verify-samples:
name: Sample ${{ matrix.sample_app }} (${{ matrix.os_version }} swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift_version: ['6.1.3', '6.2', 'nightly']
os_version: ['jammy']
jdk_vendor: ['corretto']
sample_app: [ # TODO: use a reusable-workflow to generate those names
'JavaDependencySampleApp',
'JavaKitSampleApp',
'JavaProbablyPrime',
'JavaSieve',
'SwiftAndJavaJarSampleLib',
'SwiftJavaExtractFFMSampleApp',
'SwiftJavaExtractJNISampleApp',
]
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
steps:
- uses: actions/checkout@v4
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- 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, sequoia, ARM64]
strategy:
fail-fast: false
matrix:
swift_version: ['6.2'] # 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',
'SwiftAndJavaJarSampleLib',
'SwiftJavaExtractFFMSampleApp',
'SwiftJavaExtractJNISampleApp',
]
steps:
- uses: actions/checkout@v4
- 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: "Verify sample ${{ matrix.sample_app }}"
run: .github/scripts/validate_sample.sh Samples/${{ matrix.sample_app }}