Skip to content

Commit

Permalink
Update PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
eygraber authored and renovate[bot] committed Mar 14, 2024
1 parent cbbec08 commit 9fc3f6c
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 11 deletions.
104 changes: 97 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,31 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check:
assemble:
runs-on: macos-14
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-java@v4.2.1
with:
distribution: 'zulu'
java-version-file: .ci-java-version

- uses: gradle/wrapper-validation-action@v2.1.1

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
gradle-home-cache-cleanup: true

- name: Run assemble task
run: ./gradlew assemble

detekt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-java@v4.2.1
with:
Expand All @@ -35,14 +55,84 @@ jobs:
gradle-version: wrapper
gradle-home-cache-cleanup: true

- name: Run checks
run: ./format --no-format && ./gradlew check detektAppleMain detektJvmMain detektCommonJsMain detektMetadataMain -x wasmBrowserTest -x wasmNodeTest
- name: Run detekt
run: ./gradlew detektAll

detekt-apple:
runs-on: macos-14
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-java@v4.2.1
with:
distribution: 'zulu'
java-version-file: .ci-java-version

- uses: gradle/wrapper-validation-action@v2.1.1

checkWindows:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
gradle-home-cache-cleanup: true

- name: Run detekt for apple targets
run: ./gradlew detektAppleMain detektAppleTest

detekt-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-java@v4.2.1
with:
distribution: 'zulu'
java-version-file: .ci-java-version

- uses: gradle/wrapper-validation-action@v2.1.1

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
gradle-home-cache-cleanup: true

- name: Run detekt for windows targets
run: ./gradlew detektMingwMain detektMingwTest

ktlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Run ktlint
run: ./format --no-format

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-java@v4.2.1
with:
distribution: 'zulu'
java-version-file: .ci-java-version

- uses: gradle/wrapper-validation-action@v2.1.1

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
gradle-home-cache-cleanup: true

- name: Run checks
run: ./gradlew lintRelease

test:
runs-on: macos-14
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-java@v4.2.1
with:
Expand All @@ -58,7 +148,7 @@ jobs:
gradle-home-cache-cleanup: true

- name: Run checks
run: ./gradlew mingwX64Test detektMingwX64Main
run: ./gradlew allTests -x wasmBrowserTest -x wasmNodeTest -x testDebug

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -Xms512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=1024m"
2 changes: 2 additions & 0 deletions uri/src/appleTest/kotlin/com/eygraber/uri/AppleUriTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import kotlin.test.Test
import kotlin.test.assertEquals

class AppleUriTest {
@Suppress("FunctionNaming")
@Test
fun nsurl_toUri_convertsCorrectly() {
val nsurl = NSURL.URLWithString("https://google.com")!!
assertEquals(nsurl.absoluteString!!, nsurl.toUri().toString())
}

@Suppress("FunctionNaming")
@Test
fun uri_toNSURL_convertsCorrectly() {
val uri = Uri.parse("https://google.com")
Expand Down
7 changes: 3 additions & 4 deletions uri/src/commonTest/kotlin/com/eygraber/uri/UriTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class UriTest {
.encodedQuery("foo=bar")
.encodedFragment("tee")
.build()
assertFalse(Uri.EMPTY.equals(null))
assertEquals(a, b)
assertEquals(b, c)
assertEquals(c, a)
Expand Down Expand Up @@ -268,11 +267,11 @@ class UriTest {
// Make sure the original URI is still intact.
assertEquals(2, first.pathSegments.size)
assertEquals("b", first.lastPathSegment)
try {
runCatching {
first.pathSegments[2]
fail()
}
catch(e: IndexOutOfBoundsException) {
}.onFailure {
if(it !is IndexOutOfBoundsException) throw it
}
assertEquals(null, Uri.EMPTY.lastPathSegment)
val withC = Uri.parse("foo:/a/b/").buildUpon().appendPath("c").build()
Expand Down

0 comments on commit 9fc3f6c

Please sign in to comment.