-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ooni/tooling
Tooling: CI + Lints
- Loading branch information
Showing
26 changed files
with
302 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'Setup' | ||
description: 'Setup Java, checkout and setup gradle' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Gradle cache | ||
uses: gradle/actions/setup-gradle@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Validate | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: macos-latest | ||
|
||
strategy: | ||
matrix: | ||
type: [Debug, Release] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Build Android | ||
run: ./gradlew assemble${{ matrix.type }} | ||
|
||
- name: Build iOS | ||
run: ./gradlew link${{ matrix.type }}FrameworkIosSimulatorArm64 | ||
|
||
android-lint: | ||
name: Android Lint | ||
runs-on: macos-latest | ||
needs: [ build ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run lint | ||
run: ./gradlew lint | ||
|
||
- name: Uploads test reports | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: android-lint-report | ||
path: composeApp/build/reports/ | ||
|
||
kotlin-lint: | ||
name: Kotlin Lint | ||
runs-on: macos-latest | ||
needs: [ build ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run lint | ||
run: ./gradlew ktlintCheck | ||
|
||
- name: Uploads test reports | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: android-lint-report | ||
path: composeApp/build/reports/ktlint/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 45 additions & 10 deletions
55
composeApp/src/commonMain/kotlin/org/ooni/engine/EventResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,64 @@ | ||
package org.ooni.engine | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
class EventResult { | ||
@SerialName("key") | ||
var key: String? = null | ||
|
||
@SerialName("value") | ||
var value: Value? = null | ||
|
||
@Serializable | ||
class Value { | ||
@SerialName("key") | ||
var key: Double = 0.0 | ||
var log_level: String? = null | ||
|
||
@SerialName("log_level") | ||
var logLevel: String? = null | ||
|
||
@SerialName("message") | ||
var message: String? = null | ||
|
||
@SerialName("percentage") | ||
var percentage: Double = 0.0 | ||
var json_str: String? = null | ||
|
||
@SerialName("json_str") | ||
var jsonStr: String? = null | ||
|
||
@SerialName("idx") | ||
var idx: Int = 0 | ||
var report_id: String? = null | ||
var probe_ip: String? = null | ||
var probe_asn: String? = null | ||
var probe_cc: String? = null | ||
var probe_network_name: String? = null | ||
var downloaded_kb: Double = 0.0 | ||
var uploaded_kb: Double = 0.0 | ||
|
||
@SerialName("report_id") | ||
var reportId: String? = null | ||
|
||
@SerialName("probe_ip") | ||
var probeIp: String? = null | ||
|
||
@SerialName("probe_asn") | ||
var probeAsn: String? = null | ||
|
||
@SerialName("probe_cc") | ||
var probeCc: String? = null | ||
|
||
@SerialName("probe_network_name") | ||
var probeNetworkName: String? = null | ||
|
||
@SerialName("downloaded_kb") | ||
var downloadedKb: Double = 0.0 | ||
|
||
@SerialName("uploaded_kb") | ||
var uploadedKb: Double = 0.0 | ||
|
||
@SerialName("input") | ||
var input: String? = null | ||
|
||
@SerialName("failure") | ||
var failure: String? = null | ||
var orig_key: String? = null | ||
|
||
@SerialName("orig_key") | ||
var origKey: String? = null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.