From f032ad6579bbc9491d50bac59e786bafda68dff6 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Fri, 5 Jan 2024 11:32:23 +0100 Subject: [PATCH 01/17] Add task to build experimental engine in android --- build.gradle | 6 +++++- engine-experimental/.gitignore | 1 + engine-experimental/build.gradle | 10 +++++++++ engine-experimental/gradle.properties | 1 + scripts/build_experimental_archive.sh | 29 +++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 engine-experimental/gradle.properties create mode 100644 scripts/build_experimental_archive.sh diff --git a/build.gradle b/build.gradle index 7a5b2861b..a43d55bb6 100644 --- a/build.gradle +++ b/build.gradle @@ -21,6 +21,10 @@ allprojects { } } -task clean(type: Delete) { +task clean(type: Delete, dependsOn: ':engine-experimental:clean') { delete rootProject.buildDir } + +task buildExperimentalArchive(dependsOn: ':engine-experimental:buildExperimentalArchive') { + println "main" +} \ No newline at end of file diff --git a/engine-experimental/.gitignore b/engine-experimental/.gitignore index ca05a70ba..cc800851e 100644 --- a/engine-experimental/.gitignore +++ b/engine-experimental/.gitignore @@ -1 +1,2 @@ /oonimkall.aar +/oonimkall-sources.jar \ No newline at end of file diff --git a/engine-experimental/build.gradle b/engine-experimental/build.gradle index e7656a0f5..4e3f56b1c 100644 --- a/engine-experimental/build.gradle +++ b/engine-experimental/build.gradle @@ -1,2 +1,12 @@ configurations.maybeCreate("default") artifacts.add("default", file('oonimkall.aar')) + +task clean(type: Delete) { + delete 'oonimkall.aar' + delete 'oonimkall-sources.jar' +} + +task buildExperimentalArchive(type: Exec) { + commandLine 'sh', 'mkdir' , '-p' , rootProject.buildDir + commandLine 'sh', "../scripts/build_experimental_archive.sh" , project.property('ooni.experimental.target') , rootProject.buildDir +} diff --git a/engine-experimental/gradle.properties b/engine-experimental/gradle.properties new file mode 100644 index 000000000..d9f16bb73 --- /dev/null +++ b/engine-experimental/gradle.properties @@ -0,0 +1 @@ +ooni.experimental.target=master diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh new file mode 100644 index 000000000..787910aed --- /dev/null +++ b/scripts/build_experimental_archive.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Define build and output directories +gitTarget=${1:-"master"} +buildDir=${2:-"./build"} + +# Create build directory and navigate into it +mkdir -p "${buildDir}" && cd "${buildDir}" + +# Clone the repository +git clone -v https://github.com/ooni/probe-cli.git + +# Navigate into the repository +cd probe-cli + +git checkout master + +git pull origin +# Checkout the target branch +git checkout -c "${gitTarget}" + +# Build the probe-cli +make android + +cp -v ./MOBILE/android/oonimkall.aar ../../engine-experimental/ +cp -v ./MOBILE/android/oonimkall-sources.jar ../../engine-experimental/ + + +echo "* Fetching geoip databases" \ No newline at end of file From 25822afa5b333905595dc0495a64be9c09df0b7f Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Fri, 5 Jan 2024 11:35:37 +0100 Subject: [PATCH 02/17] update task log --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a43d55bb6..e35384ad8 100644 --- a/build.gradle +++ b/build.gradle @@ -26,5 +26,5 @@ task clean(type: Delete, dependsOn: ':engine-experimental:clean') { } task buildExperimentalArchive(dependsOn: ':engine-experimental:buildExperimentalArchive') { - println "main" + println "invoking buildExperimentalArchive" } \ No newline at end of file From 492af69c2d2d2e00fdd9cdccec97115bd11b8dd4 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Fri, 5 Jan 2024 11:36:42 +0100 Subject: [PATCH 03/17] update task log --- scripts/build_experimental_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index 787910aed..4186d2b38 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -26,4 +26,4 @@ cp -v ./MOBILE/android/oonimkall.aar ../../engine-experimental/ cp -v ./MOBILE/android/oonimkall-sources.jar ../../engine-experimental/ -echo "* Fetching geoip databases" \ No newline at end of file +echo "Done building engine archive." From 6c43d279e9032ada61fabb466429abbff027018a Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 10 Jan 2024 07:48:56 +0100 Subject: [PATCH 04/17] Update scripts/build_experimental_archive.sh Co-authored-by: Simone Basso --- scripts/build_experimental_archive.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index 4186d2b38..af28b9277 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -euxo pipefail # Define build and output directories gitTarget=${1:-"master"} From 1faff56384dcbed35eaa813b31381c1f27a8f519 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 10 Jan 2024 08:13:17 +0100 Subject: [PATCH 05/17] Updated code based on review --- scripts/build_experimental_archive.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index af28b9277..a0d904069 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -5,8 +5,12 @@ set -euxo pipefail gitTarget=${1:-"master"} buildDir=${2:-"./build"} +if [ -d "$buildDir" ]; then rm -Rf $buildDir; fi + # Create build directory and navigate into it -mkdir -p "${buildDir}" && cd "${buildDir}" +mkdir -p "${buildDir}" + +cd "${buildDir}" # Clone the repository git clone -v https://github.com/ooni/probe-cli.git @@ -14,11 +18,8 @@ git clone -v https://github.com/ooni/probe-cli.git # Navigate into the repository cd probe-cli -git checkout master - -git pull origin # Checkout the target branch -git checkout -c "${gitTarget}" +git checkout "${gitTarget}" # Build the probe-cli make android From 03478e2fe582db4fc1ba24b4e4cccc78a26ac0e2 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Sat, 13 Jan 2024 18:43:23 +0100 Subject: [PATCH 06/17] added sample of gradle property file --- engine-experimental/gradle.example.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 engine-experimental/gradle.example.properties diff --git a/engine-experimental/gradle.example.properties b/engine-experimental/gradle.example.properties new file mode 100644 index 000000000..d9f16bb73 --- /dev/null +++ b/engine-experimental/gradle.example.properties @@ -0,0 +1 @@ +ooni.experimental.target=master From 444b869e0ce1f9981374a4204117d80f25384130 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Tue, 30 Jan 2024 19:55:59 +0100 Subject: [PATCH 07/17] Adds ci workflow to build experimental archive from `ooni/probe-cli` --- .../workflows/build_experimental_engine.yml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build_experimental_engine.yml diff --git a/.github/workflows/build_experimental_engine.yml b/.github/workflows/build_experimental_engine.yml new file mode 100644 index 000000000..04b627d6a --- /dev/null +++ b/.github/workflows/build_experimental_engine.yml @@ -0,0 +1,32 @@ +name: build_experimental_engine + +on: [push] + +jobs: + build_android: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Get GOVERSION content + id: goversion + run: echo "version=$(cat GOVERSION)" >> "$GITHUB_OUTPUT" + shell: bash + + - uses: magnetikonline/action-golang-cache@v4 + with: + go-version: "${{ steps.goversion.outputs.version }}" + cache-key-suffix: "-coverage-${{ steps.goversion.outputs.version }}" + + - name: Build Experimental Archive from `ooni/probe-cli` + run: ./gradlew buildExperimentalArchive \ No newline at end of file From 43f514d6056f62138b08f62a645471b0b67b32c4 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Tue, 30 Jan 2024 19:58:05 +0100 Subject: [PATCH 08/17] Adds ci workflow to build experimental archive from `ooni/probe-cli` --- scripts/build_experimental_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index a0d904069..2f128a8b4 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -euxo pipefail +#set -euxo pipefail # Define build and output directories gitTarget=${1:-"master"} From b6a22f6fad9a5649733da8b7a3eb4f8083b2060b Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Tue, 30 Jan 2024 20:41:09 +0100 Subject: [PATCH 09/17] Update workflow file --- .../workflows/build_experimental_engine.yml | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_experimental_engine.yml b/.github/workflows/build_experimental_engine.yml index 04b627d6a..b1e80b595 100644 --- a/.github/workflows/build_experimental_engine.yml +++ b/.github/workflows/build_experimental_engine.yml @@ -1,9 +1,15 @@ -name: build_experimental_engine +name: Build Experimental Engine -on: [push] +on: + push: + branches: + - master + pull_request: + schedule: + - cron: "0 2 * * */2" jobs: - build_android: + build_experimental_engine: runs-on: ubuntu-22.04 steps: @@ -29,4 +35,13 @@ jobs: cache-key-suffix: "-coverage-${{ steps.goversion.outputs.version }}" - name: Build Experimental Archive from `ooni/probe-cli` - run: ./gradlew buildExperimentalArchive \ No newline at end of file + run: ./gradlew buildExperimentalArchive + + - name: Build Experimental App + run: ./gradlew assembleExperimentalFullDebug + + - name: Archive Experimental APK + uses: actions/upload-artifact@v3 + with: + name: app-experimental-full-debug + path: app/build/outputs/apk/experimentalFull/debug/app-experimental-full-debug.apk From a4c70205ccf006f159d5465e9cfd5f6a28faba4b Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Tue, 30 Jan 2024 21:03:21 +0100 Subject: [PATCH 10/17] Update build script --- scripts/build_experimental_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index 2f128a8b4..a0d904069 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,5 +1,5 @@ #!/bin/sh -#set -euxo pipefail +set -euxo pipefail # Define build and output directories gitTarget=${1:-"master"} From 738e1de7154ff92c58a1158658e573ddbaec228b Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 31 Jan 2024 11:45:17 +0100 Subject: [PATCH 11/17] changed runner --- .github/workflows/build_experimental_engine.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_experimental_engine.yml b/.github/workflows/build_experimental_engine.yml index b1e80b595..5e50ffa22 100644 --- a/.github/workflows/build_experimental_engine.yml +++ b/.github/workflows/build_experimental_engine.yml @@ -10,7 +10,7 @@ on: jobs: build_experimental_engine: - runs-on: ubuntu-22.04 + runs-on: macos-latest steps: - uses: actions/checkout@v4 From 47bcfc3c08c65e00b3c6add3a7d95c2228597b3e Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 31 Jan 2024 12:15:46 +0100 Subject: [PATCH 12/17] changed runner --- .github/workflows/build_experimental_engine.yml | 2 +- scripts/build_experimental_archive.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_experimental_engine.yml b/.github/workflows/build_experimental_engine.yml index 5e50ffa22..b1e80b595 100644 --- a/.github/workflows/build_experimental_engine.yml +++ b/.github/workflows/build_experimental_engine.yml @@ -10,7 +10,7 @@ on: jobs: build_experimental_engine: - runs-on: macos-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index a0d904069..2f128a8b4 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -euxo pipefail +#set -euxo pipefail # Define build and output directories gitTarget=${1:-"master"} From 04ac4ca078602b1727f7ec10f5b4c0922e34a449 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 31 Jan 2024 12:43:31 +0100 Subject: [PATCH 13/17] Updated step to get go version --- .github/workflows/build_experimental_engine.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_experimental_engine.yml b/.github/workflows/build_experimental_engine.yml index b1e80b595..018dabf28 100644 --- a/.github/workflows/build_experimental_engine.yml +++ b/.github/workflows/build_experimental_engine.yml @@ -26,7 +26,7 @@ jobs: - name: Get GOVERSION content id: goversion - run: echo "version=$(cat GOVERSION)" >> "$GITHUB_OUTPUT" + run: echo "version=$(curl https://raw.githubusercontent.com/ooni/probe-cli/master/GOVERSION && cat GOVERSION)" >> "$GITHUB_OUTPUT" shell: bash - uses: magnetikonline/action-golang-cache@v4 From c2278a3561670c003be9642c4219ad7b02e19c64 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 31 Jan 2024 13:06:49 +0100 Subject: [PATCH 14/17] changed script --- scripts/build_experimental_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index 2f128a8b4..a0d904069 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,5 +1,5 @@ #!/bin/sh -#set -euxo pipefail +set -euxo pipefail # Define build and output directories gitTarget=${1:-"master"} From c544f21247eed59788efe766aa0266dcea260e46 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 31 Jan 2024 13:23:31 +0100 Subject: [PATCH 15/17] changed script --- scripts/build_experimental_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index a0d904069..3792ebe3f 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -euxo pipefail +set -eux # Define build and output directories gitTarget=${1:-"master"} From 29d0e56695b1254e56e3c9a9b8e4c6014962f87b Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Fri, 21 Jun 2024 09:30:01 +0100 Subject: [PATCH 16/17] Update scripts/build_experimental_archive.sh Co-authored-by: Simone Basso --- scripts/build_experimental_archive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_experimental_archive.sh b/scripts/build_experimental_archive.sh index 3792ebe3f..a0d904069 100644 --- a/scripts/build_experimental_archive.sh +++ b/scripts/build_experimental_archive.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -eux +set -euxo pipefail # Define build and output directories gitTarget=${1:-"master"} From 956ae096be01d2da5db749bba430e5c69b62fc24 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Fri, 21 Jun 2024 09:30:27 +0100 Subject: [PATCH 17/17] Update .github/workflows/build_experimental_engine.yml Co-authored-by: Simone Basso --- .github/workflows/build_experimental_engine.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_experimental_engine.yml b/.github/workflows/build_experimental_engine.yml index 018dabf28..3c59492cd 100644 --- a/.github/workflows/build_experimental_engine.yml +++ b/.github/workflows/build_experimental_engine.yml @@ -32,7 +32,7 @@ jobs: - uses: magnetikonline/action-golang-cache@v4 with: go-version: "${{ steps.goversion.outputs.version }}" - cache-key-suffix: "-coverage-${{ steps.goversion.outputs.version }}" + cache-key-suffix: "-build-experimental-engine-${{ steps.goversion.outputs.version }}" - name: Build Experimental Archive from `ooni/probe-cli` run: ./gradlew buildExperimentalArchive