Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up Gradle, and setup workflows #9

Merged
merged 3 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/build.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Publish all libs, Arrow-stack and Docs"

on:
workflow_dispatch:
branches: [main]
inputs:
version:
description: 'Version'
required: true
type: string

env:
BASEDIR: ${{github.workspace}}/arrow-libs
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
OSS_USER: '${{ secrets.OSS_USER }}'
OSS_TOKEN: '${{ secrets.OSS_TOKEN }}'
OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}'
SIGNING_KEY_NAME: '${{ secrets.SIGNING_KEY_NAME }}'
SIGNING_KEY_ID: '${{ secrets.SIGNING_KEY_ID }}'
SIGNING_KEY_PASSPHRASE: '${{ secrets.SIGNING_KEY_PASSPHRASE }}'
SIGNING_KEY: '${{ secrets.SIGNING_KEY }}'

jobs:
publish:
timeout-minutes: 90
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble -Pversion=${{ inputs.version }} -Pkotlin.mpp.enableCompatibilityMetadataVariant=true

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: 'reports-${{ matrix.os }}'
path: '**/build/reports/**'

- name: Publish final version
uses: gradle/gradle-build-action@v2
with:
arguments: -Pkotlin.mpp.enableCompatibilityMetadataVariant=true -Pversion=${{ inputs.version }} publishToSonatype closeSonatypeStagingRepository
119 changes: 119 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: "pull_request"

on: pull_request

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.kotlin.dsl.internal.io.timeout=120000 -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"

concurrency:
group: pull_request-${{ github.ref }}
cancel-in-progress: true

jobs:
ios_watchos:
runs-on: macos-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: ios and watchos tests
uses: gradle/gradle-build-action@v2
with:
arguments: iosSimulatorArm64Test iosX64Test watchosSimulatorArm64Test watchosX64Test watchosX86Test --parallel --scan

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: 'reports-ios_watchos'
path: '**/build/reports/**'

macos_tvos:
runs-on: macos-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: macos and tvos tests
uses: gradle/gradle-build-action@v2
with:
arguments: macosArm64Test macosX64Test tvosSimulatorArm64Test tvosX64Test --parallel --scan

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: 'reports-macos_tvos'
path: '**/build/reports/**'

windows:
runs-on: windows-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: mingwX64Test
uses: gradle/gradle-build-action@v2
with:
arguments: mingwX64Test --scan

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: 'reports-windows'
path: '**/build/reports/**'

build:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: build
uses: gradle/gradle-build-action@v2
with:
arguments: build --scan

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: 'reports-jvmTest'
path: '**/build/reports/**'
58 changes: 13 additions & 45 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,70 +1,38 @@
plugins {
kotlin("multiplatform") version "1.8.21" apply true
id("io.kotest.multiplatform") version "5.6.0" apply true
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotest.multiplatform)
alias(libs.plugins.arrow.config.formatter)
alias(libs.plugins.arrow.config.kotlin)
alias(libs.plugins.kotlinx.kover)
}

group "org.example"
version "1.0"

repositories {
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}

kotlin {
jvm()

js(IR) {
browser()
nodejs()
}

linuxX64()

mingwX64()

iosArm64()
iosSimulatorArm64()
iosX64()
macosArm64()
macosX64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
watchosArm32()
watchosArm64()
watchosSimulatorArm64()
watchosX64()

sourceSets {
commonMain {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("io.arrow-kt:arrow-core:1.2.0-RC")
implementation(libs.kotlin.stdlib)
implementation(libs.arrow.core)
}
}

commonTest {
dependencies {
implementation("io.kotest:kotest-property:5.6.1")
implementation("io.kotest:kotest-framework-engine:5.6.1")
implementation("io.kotest:kotest-assertions-core:5.6.1")
implementation("io.kotest:kotest-framework-datatest:5.6.1")
implementation("io.kotest.extensions:kotest-assertions-arrow:1.3.3")
implementation(libs.kotest.assertions)
implementation(libs.kotest.property)
implementation(libs.kotest.engine)
implementation(libs.kotest.datatest)
implementation(libs.kotest.arrow)
}
}

val jvmTest by getting {
dependencies {
implementation("io.kotest:kotest-runner-junit5-jvm:5.6.1")
implementation("io.kotest:kotest-runner-junit5:5.6.1")
implementation(libs.kotest.junit5)
}
}
}
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
kotlin.code.style=official
kotlin.code.style=official

projects.group = "io.arrow-kt"
projects.version = "0.0.1-SNAPSHOT"
33 changes: 33 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[versions]
kotlin = "1.8.21"
arrow = "1.2.0-RC"
arrow-config = "0.11.0-alpha.1"
dokka = "1.8.10"
kotest = "5.6.1"
kotest-arrow = "1.3.3"
kover = "0.6.1"
kotlinBinaryCompatibilityValidator = "0.12.1"
knit = "0.4.0"

[libraries]
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib" }
arrow-core = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" }
kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-engine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" }
kotest-datatest = { module = "io.kotest:kotest-framework-datatest", version.ref = "kotest" }
kotest-arrow = { module = "io.kotest.extensions:kotest-assertions-arrow", version.ref = "kotest-arrow" }
kotest-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
kotlinx-knit = { module = "org.jetbrains.kotlinx:kotlinx-knit", version.ref = "knit" }

[plugins]
arrow-config-formatter = { id = "io.arrow-kt.arrow-gradle-config-formatter", version.ref = "arrow-config" }
arrow-config-kotlin = { id = "io.arrow-kt.arrow-gradle-config-kotlin", version.ref = "arrow-config" }
arrow-config-nexus = { id = "io.arrow-kt.arrow-gradle-config-nexus", version.ref = "arrow-config" }
arrow-config-publish = { id = "io.arrow-kt.arrow-gradle-config-publish", version.ref = "arrow-config" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotest-multiplatform = { id = "io.kotest.multiplatform", version.ref = "kotest" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBinaryCompatibilityValidator" }
kotlinx-knit = { id = "org.jetbrains.kotlinx.knit", version.ref = "knit" }
kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading