Skip to content

cache downloaded swiftpm artifacts #72

cache downloaded swiftpm artifacts

cache downloaded swiftpm artifacts #72

Workflow file for this run

name: pull_request
on:
pull_request:
types: [ opened, reopened, synchronize ]
jobs:
soundness:
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
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
# FIXME: we're about to remove _Subprocess immediately anyway, so rather than fixing it one by one remove this adjusted list and use the default again ASAP
# swift-subprocess includes the word "kill" because SIGKILL signal handling so we allow it
unacceptable_language_check_word_list: "blacklist whitelist slave master sane sanity insane insanity killed killing hang hung hanged hanging" #ignore-unacceptable-language
test-java:
name: Java tests (swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}} os:${{ matrix.os_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
swift_version: [ 'nightly-main' ]
os_version: [ 'jammy' ]
jdk_vendor: [ 'Corretto' ]
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
env:
JAVA_HOME: "/usr/lib/jvm/default-jdk"
steps:
- uses: actions/checkout@v4
- name: Install System Dependencies
run: apt-get -qq update && apt-get -qq install -y make curl wget
- name: Install JDK
run: "bash -xc 'JDK_VENDOR=${{ matrix.jdk_vendor }} ./docker/install_jdk.sh'"
# TODO: not using setup-java since incompatible with the swiftlang/swift base image
- name: Install Nightly Swift
run: "bash -xc './docker/install_untested_nightly_swift.sh'"
- name: Cache local Gradle repository
uses: actions/cache@v4
continue-on-error: true
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-cache
${{ runner.os }}-gradle-
- name: Cache local SwiftPM repository
uses: actions/cache@v4
continue-on-error: true
with:
path: ~/.swiftpm/cache
key: ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
restore-keys: |
${{ runner.os }}-swiftpm-cache
${{ runner.os }}-swiftpm-
- name: Gradle build
run: ./gradlew build --info --no-daemon
- name: List files for debugging
run: ls -R /home/runner/work/swift-java/swift-java
- name: List files for debugging
run: ls -R ~/
test-swift:
name: Swift tests (swift:${{ matrix.swift_version }} jdk:${{matrix.jdk_vendor}} os:${{ matrix.os_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift_version: [ 'nightly-main' ]
os_version: [ 'jammy' ]
jdk_vendor: [ 'Corretto' ]
container:
image: ${{ (contains(matrix.swift_version, 'nightly') && 'swiftlang/swift') || 'swift' }}:${{ matrix.swift_version }}-${{ matrix.os_version }}
env:
JAVA_HOME: "/usr/lib/jvm/default-jdk"
steps:
- uses: actions/checkout@v4
- name: Install System Dependencies
run: apt-get -qq update && apt-get -qq install -y make curl wget
- name: Install JDK
run: "bash -xc 'JDK_VENDOR=${{ matrix.jdk_vendor }} ./docker/install_jdk.sh'"
- name: Install Nightly Swift
run: "bash -xc './docker/install_untested_nightly_swift.sh'"
- name: Cache local SwiftPM repository
uses: actions/cache@v4
continue-on-error: true
with:
path: ~/.gradle/cache
key: ${{ runner.os }}-swiftpm-cache-${{ hashFiles('Package.swift') }}
restore-keys: |
${{ runner.os }}-swiftpm-cache
${{ runner.os }}-swiftpm-
- name: Generate sources (make) (Temporary)
# TODO: this should be triggered by the respective builds
run: "make jextract-run"
- name: Test Swift
run: "swift test"