Skip to content

Commit cf6849f

Browse files
committed
Adds multiple changes:
* Fixed Shape class get operator to use single index parameter * Updated error messages in DoublesTensor matmul * Fixed Flatten implementation to preserve batch dimension #7 * Fixed GGUF reader tests with correct test resources #19 * Fixed CsvParameterLoader to handle parameter structure correctly * Re-enabled io and gguf modules * Added test running with detailed reporting to GitHub Actions workflow for better debugging Related-To: #2
1 parent 6db36dc commit cf6849f

18 files changed

Lines changed: 536 additions & 177 deletions

File tree

.github/workflows/build.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,40 @@ jobs:
2929
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
3030

3131
- name: Build
32-
run: ./gradlew --stacktrace clean assemble
32+
run: ./gradlew --stacktrace clean assemble
33+
34+
- name: Run Tests
35+
run: ./gradlew --stacktrace test
36+
37+
- name: Display Test Results
38+
if: always()
39+
run: |
40+
echo "Test Results Summary:"
41+
find . -type f -path "*/build/test-results/*/TEST-*.xml" | while read file; do
42+
echo "File: $file"
43+
# Extract test class name
44+
class_name=$(grep 'testcase classname=' "$file" | head -1 | sed 's/.*classname="\([^"]*\)".*/\1/')
45+
echo "Class: $class_name"
46+
47+
# Count total, failures, and errors
48+
total=$(grep -c '<testcase' "$file" || echo 0)
49+
failures=$(grep -c '<failure' "$file" || echo 0)
50+
errors=$(grep -c '<error' "$file" || echo 0)
51+
echo "Total: $total, Failures: $failures, Errors: $errors"
52+
53+
# Print details of failures and errors
54+
if [ $failures -gt 0 ] || [ $errors -gt 0 ]; then
55+
echo "Failed Tests:"
56+
grep -A 3 '<failure\|<error' "$file" | grep -v '^--$'
57+
fi
58+
echo "----------------------------------------"
59+
done
60+
61+
- name: Upload Test Reports
62+
if: always()
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: test-reports
66+
path: |
67+
*/build/reports/tests/
68+
*/build/test-results/

build.gradle.kts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,38 @@
1-
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
1+
//import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
22

33
plugins {
44
alias(libs.plugins.androidLibrary) apply false
55
alias(libs.plugins.kotlinMultiplatform) apply false
66
alias(libs.plugins.jetbrainsKotlinJvm) apply false
77
alias(libs.plugins.binaryCompatibility) apply false
8-
alias(libs.plugins.dokka) apply false
8+
//alias(libs.plugins.dokka) apply false
99
alias(libs.plugins.modulegraph.souza) apply true
1010
}
1111

12-
apply(plugin = "org.jetbrains.dokka")
12+
//apply(plugin = "org.jetbrains.dokka")
1313

1414
allprojects {
1515
group = "sk.ai.net"
1616
version = "0.0.6-SNAPSHOT"
1717
}
1818

19+
// Task to run all tests in the project
20+
tasks.register("allTests") {
21+
group = "verification"
22+
description = "Runs all tests in the project"
23+
24+
// Depend on all test tasks from all subprojects
25+
dependsOn(subprojects.map { it.tasks.matching { task -> task.name.contains("test", ignoreCase = true) && task.name.contains("compile", ignoreCase = true).not() } })
26+
}
27+
1928
moduleGraphConfig {
2029
readmePath.set("./Modules.md")
2130
heading = "### Module Graph"
2231
}
2332

33+
/*
2434
tasks.register<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>("dokkaHtmlMultiModule") {
2535
outputDirectory.set(buildDir.resolve("dokka"))
2636
}
37+
38+
*/

core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
alias(libs.plugins.kotlinMultiplatform)
99
alias(libs.plugins.androidLibrary)
1010
alias(libs.plugins.binaryCompatibility)
11-
alias(libs.plugins.dokka)
11+
// alias(libs.plugins.dokka)
1212
alias(libs.plugins.vanniktech.mavenPublish)
1313
}
1414

@@ -43,7 +43,7 @@ kotlin {
4343
}
4444

4545
android {
46-
namespace = "sk.ai.net.core"
46+
namespace = "sk.ai.net.io"
4747
compileSdk = libs.versions.android.compileSdk.get().toInt()
4848
defaultConfig {
4949
minSdk = libs.versions.android.minSdk.get().toInt()

core/src/commonMain/kotlin/sk/ai/net/Shape.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class Shape(vararg dimensions: Int) {
2424
}
2525
}
2626

27-
operator fun get(vararg indices: Int): Int {
28-
return dimensions[index(indices)]
27+
operator fun get(index: Int): Int {
28+
return dimensions[index]
2929
}
3030

3131
override fun equals(other: Any?): Boolean {
@@ -52,4 +52,4 @@ class Shape(vararg dimensions: Int) {
5252
return "Shape: Dimensions = $dimensionsString, Size (Volume) = $volume"
5353
}
5454

55-
}
55+
}

0 commit comments

Comments
 (0)