Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Dec 18, 2024
1 parent ce5633b commit b6aaa77
Show file tree
Hide file tree
Showing 13 changed files with 2,625 additions and 266 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/build-linux-amd64.sh

This file was deleted.

94 changes: 0 additions & 94 deletions .github/workflows/build-mac.sh

This file was deleted.

135 changes: 73 additions & 62 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,84 +13,89 @@ env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
build:
zig:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0

- run: zig build -p src/jvmMain/resources/jni
working-directory: zipline

- uses: actions/upload-artifact@v4
with:
name: jni-binaries
path: zipline/src/jvmMain/resources/jni
if-no-files-found: error

platform-tests:
needs:
- zig
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [amd64]
cmake-arch: [x86_64]
include:
- os: macos-latest-large
arch: x86_64
cmake-arch: x86_64
platform:
- os: macos-13
task: macosX64Test
- os: macos-latest
arch: aarch64
cmake-arch: arm64
# TODO: build on 'windows-latest'
task: macosArm64Test
- os: ubuntu-latest
task: linuxX64Test

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.platform.os }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20

- name: Build native library (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y libtinfo6
cp -a . ../zipline-dockerbuild
docker build \
--tag zipline-linux-amd64 \
.github/workflows
docker run \
--volume `pwd`/../zipline-dockerbuild:/zipline \
--workdir /zipline \
--entrypoint ./.github/workflows/build-linux-amd64.sh \
zipline-linux-amd64
mkdir -p zipline/src/jvmMain/resources/jni/amd64
cp -v ../zipline-dockerbuild/build/jni/amd64/libquickjs.* zipline/src/jvmMain/resources/jni/amd64/
- name: Build native library (macOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-latest-large'
run: ./.github/workflows/build-mac.sh -a ${{ matrix.arch }} -c ${{ matrix.cmake-arch }}

- name: Zipline tests
run: ./gradlew :zipline:check --stacktrace

- name: Build all Zipline
if: matrix.os == 'macos-latest'
run: ./gradlew build --stacktrace

- name: Build samples
if: matrix.os == 'macos-latest'
run: ./gradlew -p samples check --stacktrace
java-version: 23

- uses: actions/upload-artifact@v4
- uses: actions/download-artifact@v4
with:
name: jvm-native-libraries-${{ matrix.os }}-${{ matrix.arch }}
path: zipline/src/jvmMain/resources/*
if-no-files-found: error
name: jni-binaries
path: zipline/src/jvmMain/resources/jni

- run: ./gradlew :zipline:jvmTest :zipline:${{ matrix.platform.task }} --stacktrace

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-report-${{ matrix.os }}-${{ matrix.arch }}
name: test-report-${{ matrix.platform.os }}
path: '**/build/reports/tests/**'
retention-days: 1

android:
samples:
runs-on: macos-latest
needs:
- zig

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 23

- uses: actions/download-artifact@v4
with:
name: jni-binaries
path: zipline/src/jvmMain/resources/jni

- run: ./gradlew -p samples check --stacktrace

android-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 23

- name: Enable KVM
run: |
Expand All @@ -106,43 +111,43 @@ jobs:
emulator-boot-timeout: 20000
script: ./gradlew connectedCheck

ios:
ios-app:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 23

- name: Build Xcode samples
run: |
cd samples/world-clock/ios/app
pod install
xcodebuild -workspace WorldClock.xcworkspace -scheme WorldClock -destination 'platform=iOS Simulator,name=iPhone 13,OS=latest'
publish:
build:
runs-on: macos-latest
needs:
- build
- android
- ios
- platform-tests
- samples
- android-tests
- ios-app

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 20
java-version: 23

- uses: actions/download-artifact@v4
with:
pattern: jvm-native-libraries-*
path: zipline/src/jvmMain/resources
merge-multiple: true
name: jni-binaries
path: zipline/src/jvmMain/resources/jni

- run: ./gradlew assemble :dokkaHtmlMultiModule
- run: ./gradlew build :dokkaHtmlMultiModule

- uses: actions/upload-artifact@v4
with:
Expand All @@ -162,6 +167,12 @@ jobs:
path: zipline-cli/build/distributions/zipline-cli-*.zip
if-no-files-found: error

- uses: actions/upload-artifact@v4
with:
name: html-docs
path: build/dokka/htmlMultiModule/
if-no-files-found: error

- run: ./gradlew publishToMavenCentral
if: ${{ github.ref == 'refs/heads/trunk' && github.repository == 'cashapp/zipline' }}
env:
Expand Down
Loading

0 comments on commit b6aaa77

Please sign in to comment.