From 4b3fc8c14c2f4e68104c9b36dfb233e4ad9daf29 Mon Sep 17 00:00:00 2001 From: Rowdy Mitchell Chotkan Date: Tue, 20 Feb 2024 18:52:59 +0100 Subject: [PATCH] Update `check` workflow + README --- .github/workflows/check.yml | 10 +++- .github/workflows/debug.yml | 37 ------------ .github/workflows/test.yml | 33 ----------- README.md | 110 +++++++++++++++++++----------------- 4 files changed, 67 insertions(+), 123 deletions(-) delete mode 100644 .github/workflows/debug.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0cbd798e0..4fa434329 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: check +name: Execute checks on: pull_request: @@ -8,7 +8,6 @@ on: jobs: test: name: Run Checks - # TODO: Ubuntu currently broken. runs-on: ubuntu-latest steps: - name: Checkout @@ -22,6 +21,13 @@ jobs: distribution: 'zulu' java-version: '17' + # TODO: Without this step, the build fails with the following error: + # Execution failed for task ':common:verifyDebugDatabaseMigration'. + # > A failure occurred while executing app.cash.sqldelight.gradle.VerifyMigrationTask$VerifyMigrationAction + # > No suitable driver found for jdbc:sqlite: + - name: Run verifyDebugDatabase + run: bash ./gradlew verifyDebugDatabaseMigration + - name: Run check run: bash ./gradlew check diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml deleted file mode 100644 index 4fa434329..000000000 --- a/.github/workflows/debug.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Execute checks - -on: - pull_request: - push: - branches: master - -jobs: - test: - name: Run Checks - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: ./.github/actions/checkout_submodules - - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '17' - - # TODO: Without this step, the build fails with the following error: - # Execution failed for task ':common:verifyDebugDatabaseMigration'. - # > A failure occurred while executing app.cash.sqldelight.gradle.VerifyMigrationTask$VerifyMigrationAction - # > No suitable driver found for jdbc:sqlite: - - name: Run verifyDebugDatabase - run: bash ./gradlew verifyDebugDatabaseMigration - - - name: Run check - run: bash ./gradlew check - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 602cc0656..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: test & lint - -on: - pull_request: - push: - branches: master - -jobs: - test: - name: Run Tests and Lint - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: ./.github/actions/checkout_submodules - - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '17' - - - name: Run tests - run: bash ./gradlew test - - - name: Run lint - run: bash ./gradlew ktlintCheck - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index df61837e9..3a508550a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,65 @@ This repository contains a collection of Android apps built on top of [IPv8](https://github.com/MattSkala/kotlin-ipv8) (our P2P networking stack) and [TrustChain](https://github.com/Tribler/kotlin-ipv8/blob/master/doc/TrustChainCommunity.md) (a scalable, distributed, pair-wise ledger). All applications are built into a single APK, following the concept of [super apps](https://home.kpmg/xx/en/home/insights/2019/06/super-app-or-super-disruption.html) – an emerging trend that allows to provide an ecosystem for multiple services within a single all-in-one app experience. +## Build Instructions + +If you want to build an APK, run the following command: + +``` +./gradlew :app:buildDebug +``` + +The resulting APK will be stored in `app/build/outputs/apk/debug/app-debug.apk`. + +### Install + +You can also build and automatically install the app on all connected Android devices with a single command: + +``` +./gradlew :app:installDebug +``` + +*Note: It is required to have an Android device connected with USB debugging enabled before running this command.* + +### Check +Run the Gradle check task to verify that the project is correctly set up and that tests pass: + +``` +./gradlew check +``` + +*Note: this task is also run on the CI, so ensure that it passes before making a PR.* + +### Tests + +Run unit tests: +``` +./gradlew test +``` + +Run instrumented tests: +``` +./gradlew connectedAndroidTest +``` + +### Code style + +[Ktlint](https://ktlint.github.io/) is used to enforce a consistent code style across the whole project. It is recommended to install the [ktlint plugin](https://plugins.jetbrains.com/plugin/15057-ktlint) for your IDE to get real-time feedback. + + +Check code style: +``` +./gradlew ktlintCheck +``` + +Run code formatter: +``` +./gradlew ktlintFormat +``` + +## Adding Your Own App +If you want to add your own app to the TrustChain Super App, you can follow the tutorial in the [AppTutorial.md](doc/AppTutorial.md) document. + ## Apps ### On-Chain Democracy @@ -104,54 +163,3 @@ A user can publish a Release (which is an album/EP/single/...), after which the Video 1: Load example. This uses a default magnet link for an album that has a decent amount of peers. The user submits the metadata and the block gets proposed and signed. Then playback. Video 2: Share track. Note: as a fresh magnet link is generated in this video, there is only 1 peer. For this reason it will be difficult to obtain the metadata of the magnet link (cold start issue, write about this in thesis) so the video stops there. - -### Do you want to add your own app? - -- [Adding your own app to the TrustChain Super App](doc/AppTutorial.md) - -## Build - -If you want to build an APK, run the following command: - -``` -./gradlew :app:buildDebug -``` - -The resulting APK will be stored in `app/build/outputs/apk/debug/app-debug.apk`. - -## Install - -You can also build and automatically install the app on all connected Android devices with a single command: - -``` -./gradlew :app:installDebug -``` - -*Note: It is required to have an Android device connected with USB debugging enabled before running this command.* - -## Tests - -Run unit tests: -``` -./gradlew test -``` -*Note: Currently tests fail on Linux, but pass on Windows and Mac. This is due to the tests relying on a native jlibtorrent binary, of which the linux version cannot be bundled with android builds. We are working on a solution to this problem.* - -Run instrumented tests: -``` -./gradlew connectedAndroidTest -``` - -## Code style - -[Ktlint](https://ktlint.github.io/) is used to enforce a consistent code style across the whole project. It is recommended to install the [ktlint plugin](https://plugins.jetbrains.com/plugin/15057-ktlint) for your IDE to get real-time feedback. - -Check code style: -``` -./gradlew ktlintCheck -``` - -Run code formatter: -``` -./gradlew ktlintFormat -```