From dcf54399431be083dfac95c9e8b49ac61d3b4d82 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 06:30:25 +0530 Subject: [PATCH 01/10] Add network config to allow clear text traffic for localhost --- app/src/main/AndroidManifest.xml | 4 +++- app/src/main/res/xml/network_config.xml | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/xml/network_config.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c71ac52a90d..e43f4abd420 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -54,10 +54,12 @@ android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:networkSecurityConfig="@xml/network_config" android:supportsRtl="true" android:theme="@style/Theme.Simple" tools:ignore="AllowBackup,DataExtractionRules,GoogleAppIndexingWarning,LockedOrientationActivity" - tools:replace="android:allowBackup"> + tools:replace="android:allowBackup" + tools:targetApi="n"> + + + + localhost:8420 + + From 435ab000fb31bc0c0601d6c13314d1ad2cc4ff31 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 06:34:21 +0530 Subject: [PATCH 02/10] Remove heroku setup and usage from CI checks workflow --- .github/workflows/ci_checks.yml | 137 ++------------------------------ 1 file changed, 8 insertions(+), 129 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 99523e17ff4..15b91988439 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -5,13 +5,6 @@ on: branches: - release/* pull_request: - workflow_dispatch: - inputs: - simple_server_branch: - required: false - type: string - default: master - workflow_call: concurrency: group: ci-${{ github.head_ref }} @@ -48,118 +41,7 @@ jobs: - name: QA Unit Tests run: ./gradlew --build-cache --no-daemon testQaDebugUnitTest - generate_server_app_name: - runs-on: [ ubuntu-latest ] - outputs: - heroku_app_name: ${{ steps.generate-server-app-name.outputs.heroku_app_name }} - steps: - - name: Checkout Android source - uses: actions/checkout@v4 - - - name: Generate server app name - id: generate-server-app-name - run: .github/scripts/generate_heroku_app_name.sh ${{ github.ref }} - - create_server_on_heroku: - needs: generate_server_app_name - runs-on: [ ubuntu-latest ] - outputs: - heroku_app_name: ${{ steps.create-server-on-heroku.outputs.heroku_app_name }} - heroku_app_url: ${{ steps.create-server-on-heroku.outputs.heroku_app_url }} - heroku_app_exists: ${{ steps.create-server-on-heroku.outputs.heroku_app_exists }} - env: - HEROKU_API_KEY: ${{ secrets.SERVICES_HEROKU_API_KEY }} - steps: - - name: Checkout Android source - uses: actions/checkout@v4 - with: - path: android-app - - - name: Checkout Server source - uses: actions/checkout@v4 - with: - repository: simpledotorg/simple-server - fetch-depth: 0 # Full clone needed for Heroku deploys (https://devcenter.heroku.com/changelog-items/775) - path: server-app - ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.simple_server_branch || 'master' }} - - - name: Install Heroku CLI - if: steps.node-dependency-cache.outputs.cache-hit != 'true' - run: npm install heroku - - - name: Link Heroku CLI globally - run: npm link heroku - - - name: Create server on Heroku - id: create-server-on-heroku - run: | - android-app/.github/scripts/create_heroku_app.sh \ - ${{ needs.generate_server_app_name.outputs.heroku_app_name }} \ - server-app - - deploy_server_on_heroku: - needs: [create_server_on_heroku] - runs-on: [ ubuntu-latest ] - timeout-minutes: 60 - outputs: - heroku_app_name: ${{ steps.start-simple-server.outputs.heroku_app_name }} - env: - HEROKU_API_KEY: ${{ secrets.SERVICES_HEROKU_API_KEY }} - steps: - - name: Checkout Android source - uses: actions/checkout@v4 - with: - path: android-app - - - name: Checkout server app source - uses: actions/checkout@v4 - with: - repository: simpledotorg/simple-server - fetch-depth: 0 # Full clone needed for Heroku deploys (https://devcenter.heroku.com/changelog-items/775) - path: server-app - ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.simple_server_branch || 'master' }} - - - name: Create node dependency hash - id: create_node_modules_hash - run: android-app/.github/scripts/compute_node_dependency_hash.sh - - - name: Cache node modules - id: node-dependency-cache - uses: actions/cache@v4 - with: - path: | - node_modules - package-lock.json - key: ${{ runner.os }}-npm-${{ steps.create_node_modules_hash.outputs.node_dep_hash }} - - - name: Install Heroku CLI - if: steps.node-dependency-cache.outputs.cache-hit != 'true' - run: npm install heroku - - - name: Link Heroku CLI globally - run: npm link heroku - - - name: Install Heroku Buildpacks registry - run: heroku plugins:install buildpack-registry - - - name: Install heroku buildpacks plugin - run: heroku plugins:install buildpacks - - - name: Deploy the server on Heroku - id: start-simple-server - run: | - android-app/.github/scripts/setup_heroku_instance.sh \ - ${{ needs.create_server_on_heroku.outputs.heroku_app_name }} \ - ${{ env.HEROKU_API_KEY }} \ - ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.simple_server_branch || 'master' }} \ - server-app \ - android-app \ - ${{ needs.create_server_on_heroku.outputs.heroku_app_exists }} \ - ${{ secrets.HEROKU_SECRET_PROPERTIES }} - - build_qa_android_tests_apk: - needs: create_server_on_heroku runs-on: [ ubuntu-latest ] timeout-minutes: 60 steps: @@ -175,8 +57,11 @@ jobs: - name: Build QA Test Artifacts id: build-instrumented-tests + env: + SIMPLE_SERVER_HOST: http://localhost:8420 run: | - ./gradlew --build-cache --no-daemon -PmanifestEndpoint=${{ needs.create_server_on_heroku.outputs.heroku_app_url }}api/ assembleQaDebug assembleQaDebugAndroidTest + ./gradlew --build-cache --no-daemon -PmanifestEndpoint=$SIMPLE_SERVER_HOST/api/ assembleQaDebug assembleQaDebugAndroidTest + - name: Upload artifacts uses: actions/upload-artifact@v4 @@ -184,10 +69,8 @@ jobs: name: test-artifacts path: app/build/outputs/apk - # reactivecircus/android-emulator-runner@v2 requires MacOS to run on - # https://github.com/ReactiveCircus/android-emulator-runner qa_android_tests: - needs: [ deploy_server_on_heroku, build_qa_android_tests_apk ] + needs: [ build_qa_android_tests_apk ] runs-on: [ ubuntu-latest ] timeout-minutes: 60 env: @@ -200,6 +83,7 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm + - name: Checkout Android source uses: actions/checkout@v4 @@ -262,6 +146,7 @@ jobs: adb uninstall org.simple.clinic.qa.debug.test ! grep -q "FAILURES\!\!\!" app/build/outputs/test-artifacts/logs.txt + - name: Upload failed test artifacts if: always() && steps.run-instrumented-tests.outcome != 'success' uses: actions/upload-artifact@v4 @@ -269,13 +154,6 @@ jobs: name: failed-test-artifacts path: app/build/outputs/test-artifacts - - name: Teardown Heroku instance - if: always() && (steps.start-simple-server.outcome != 'success' || contains(github.ref, '/release/')) - run: | - heroku apps:destroy \ - --app=${{ needs.deploy_server_on_heroku.outputs.heroku_app_name }} \ - --confirm=${{ needs.deploy_server_on_heroku.outputs.heroku_app_name }} - mobius_migration_tests: runs-on: [ ubuntu-latest ] steps: @@ -326,6 +204,7 @@ jobs: run: | rm -f release/simple.store + verify_room_schemas: runs-on: [ ubuntu-latest ] steps: From f0ee7ccb20e4a58b72b3d10d0b4085ae75fa0df7 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 06:38:28 +0530 Subject: [PATCH 03/10] Refactor CI checks workflow to use Simple Docker server for integration tests --- .github/workflows/ci_checks.yml | 44 +++++++++++---------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 15b91988439..170983a9bd6 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -41,34 +41,6 @@ jobs: - name: QA Unit Tests run: ./gradlew --build-cache --no-daemon testQaDebugUnitTest - build_qa_android_tests_apk: - runs-on: [ ubuntu-latest ] - timeout-minutes: 60 - steps: - - name: Checkout Android source - uses: actions/checkout@v4 - - - name: set up JDK - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: 17 - cache: 'gradle' - - - name: Build QA Test Artifacts - id: build-instrumented-tests - env: - SIMPLE_SERVER_HOST: http://localhost:8420 - run: | - ./gradlew --build-cache --no-daemon -PmanifestEndpoint=$SIMPLE_SERVER_HOST/api/ assembleQaDebug assembleQaDebugAndroidTest - - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: test-artifacts - path: app/build/outputs/apk - qa_android_tests: needs: [ build_qa_android_tests_apk ] runs-on: [ ubuntu-latest ] @@ -87,6 +59,10 @@ jobs: - name: Checkout Android source uses: actions/checkout@v4 + - name: Start Simple Docker server + run: | + docker compose -f ".github/docker/simple-server.compose.yml" up -d + - name: Cache AVD uses: actions/cache@v4 id: avd-cache @@ -124,6 +100,13 @@ jobs: name: test-artifacts path: app/build/outputs/apk + - name: Build QA Test Artifacts + id: build-instrumented-tests + env: + SIMPLE_SERVER_HOST: http://localhost:8420 + run: | + ./gradlew --build-cache --no-daemon -PmanifestEndpoint=$SIMPLE_SERVER_HOST/api/ assembleQaDebug assembleQaDebugAndroidTest + - name: QA Android Tests id: run-instrumented-tests uses: reactivecircus/android-emulator-runner@v2 @@ -146,7 +129,6 @@ jobs: adb uninstall org.simple.clinic.qa.debug.test ! grep -q "FAILURES\!\!\!" app/build/outputs/test-artifacts/logs.txt - - name: Upload failed test artifacts if: always() && steps.run-instrumented-tests.outcome != 'success' uses: actions/upload-artifact@v4 @@ -154,6 +136,10 @@ jobs: name: failed-test-artifacts path: app/build/outputs/test-artifacts + - name: Stop Simple Docker server + run: | + docker compose -f ".github/docker/simple-server.compose.yml" down + mobius_migration_tests: runs-on: [ ubuntu-latest ] steps: From 43598a3f744e09b72d48b8f9e2de33b4c5e6798e Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 06:40:48 +0530 Subject: [PATCH 04/10] Refactor jobs ordering in `ci_checks` workflow --- .github/workflows/ci_checks.yml | 162 ++++++++++++++++---------------- 1 file changed, 83 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 170983a9bd6..c76b196cef7 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -11,6 +11,87 @@ concurrency: cancel-in-progress: true jobs: + verify_changelog_updated: + runs-on: [ ubuntu-latest ] + if: github.event_name == 'pull_request' + steps: + - name: Checkout master + uses: actions/checkout@v4 + with: + ref: master + path: master + + - name: Checkout current + uses: actions/checkout@v4 + with: + path: current + + - name: Verify CHANGELOG was updated + run: current/.github/scripts/verify_file_was_changed.sh master/CHANGELOG.md current/CHANGELOG.md + + verify_pr_description: + runs-on: [ ubuntu-latest ] + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@v4 + - name: Verify PR description + run: kotlinc -script ".github/scripts/PrCommentCheck.main.kts" "${{ github.event.pull_request.body }}" + + verify_room_schemas: + runs-on: [ ubuntu-latest ] + steps: + - name: Checkout master + uses: actions/checkout@v4 + with: + ref: master + path: master + + - name: Checkout current + uses: actions/checkout@v4 + with: + path: current + + - name: Verify existing Room schemas are not modified + run: current/.github/scripts/compare_directory_contents.sh master/app/schemas/org.simple.clinic.AppDatabase current/app/schemas/org.simple.clinic.AppDatabase + + verify_release_bundles: + runs-on: [ ubuntu-latest ] + env: + TERM: dumb + ORG_GRADLE_PROJECT_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + ORG_GRADLE_PROJECT_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + ORG_GRADLE_PROJECT_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + strategy: + matrix: + buildType: [ 'Production' ] + steps: + - uses: actions/checkout@v4 + + - name: set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 17 + cache: 'gradle' + + - name: Decrypt secrets + run: gpg --batch --yes --quiet --decrypt --passphrase=${{ secrets.KEYSTORE_PASSPHRASE }} --output release/simple.store release/simple.gpg + + - name: Build ${{ matrix.buildType }} Release bundle + run: | + ./gradlew \ + -PrunProguard=true \ + -PdefaultProguardFile=proguard-android.txt \ + -PsentryUploadProguard=false \ + bundle${{ matrix.buildType }}Release + + - name: Clean secrets + run: | + rm -f release/simple.store + + + + qa_lint: runs-on: [ ubuntu-latest ] steps: @@ -140,6 +221,8 @@ jobs: run: | docker compose -f ".github/docker/simple-server.compose.yml" down + + mobius_migration_tests: runs-on: [ ubuntu-latest ] steps: @@ -155,85 +238,6 @@ jobs: - name: Mobius Migration Tests run: ./gradlew :mobius-migration:test - verify_release_bundles: - runs-on: [ ubuntu-latest ] - env: - TERM: dumb - ORG_GRADLE_PROJECT_KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - ORG_GRADLE_PROJECT_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - ORG_GRADLE_PROJECT_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - strategy: - matrix: - buildType: [ 'Production' ] - steps: - - uses: actions/checkout@v4 - - - name: set up JDK - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: 17 - cache: 'gradle' - - - name: Decrypt secrets - run: gpg --batch --yes --quiet --decrypt --passphrase=${{ secrets.KEYSTORE_PASSPHRASE }} --output release/simple.store release/simple.gpg - - - name: Build ${{ matrix.buildType }} Release bundle - run: | - ./gradlew \ - -PrunProguard=true \ - -PdefaultProguardFile=proguard-android.txt \ - -PsentryUploadProguard=false \ - bundle${{ matrix.buildType }}Release - - - name: Clean secrets - run: | - rm -f release/simple.store - - - verify_room_schemas: - runs-on: [ ubuntu-latest ] - steps: - - name: Checkout master - uses: actions/checkout@v4 - with: - ref: master - path: master - - - name: Checkout current - uses: actions/checkout@v4 - with: - path: current - - - name: Verify existing Room schemas are not modified - run: current/.github/scripts/compare_directory_contents.sh master/app/schemas/org.simple.clinic.AppDatabase current/app/schemas/org.simple.clinic.AppDatabase - - verify_pr_description: - runs-on: [ ubuntu-latest ] - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v4 - - name: Verify PR description - run: kotlinc -script ".github/scripts/PrCommentCheck.main.kts" "${{ github.event.pull_request.body }}" - - verify_changelog_updated: - runs-on: [ ubuntu-latest ] - if: github.event_name == 'pull_request' - steps: - - name: Checkout master - uses: actions/checkout@v4 - with: - ref: master - path: master - - - name: Checkout current - uses: actions/checkout@v4 - with: - path: current - - - name: Verify CHANGELOG was updated - run: current/.github/scripts/verify_file_was_changed.sh master/CHANGELOG.md current/CHANGELOG.md - fix_strings_ellipsise: runs-on: [ ubuntu-latest ] if: github.event_name == 'pull_request' From c8c695c65316a25cc1a792137355658441671a24 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 06:44:06 +0530 Subject: [PATCH 05/10] Remove unused config in `qa_android_tests` job --- .github/workflows/ci_checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index c76b196cef7..17d2c0121d9 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -123,7 +123,6 @@ jobs: run: ./gradlew --build-cache --no-daemon testQaDebugUnitTest qa_android_tests: - needs: [ build_qa_android_tests_apk ] runs-on: [ ubuntu-latest ] timeout-minutes: 60 env: From cfc718ed5bedf48e56f4dc7f436148f6783c24fb Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 06:48:43 +0530 Subject: [PATCH 06/10] Remove download artifact step from `qa_android_tests` job --- .github/workflows/ci_checks.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 17d2c0121d9..a95a384215b 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -174,12 +174,6 @@ jobs: - name: Create build directory run: mkdir app/build - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: test-artifacts - path: app/build/outputs/apk - - name: Build QA Test Artifacts id: build-instrumented-tests env: From 4aea6185c445ac039e8f6572b0942d70394bc83e Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 07:06:06 +0530 Subject: [PATCH 07/10] Remove port from localhost domain in network config --- app/src/main/res/xml/network_config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/xml/network_config.xml b/app/src/main/res/xml/network_config.xml index 49c5f6c8f9e..f5dfbe7d47d 100644 --- a/app/src/main/res/xml/network_config.xml +++ b/app/src/main/res/xml/network_config.xml @@ -2,6 +2,6 @@ - localhost:8420 + localhost From 51bdfacd7157844c1d8541b99db209c9281d5217 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Thu, 28 Nov 2024 08:50:20 +0530 Subject: [PATCH 08/10] Use Docker container IP address and port as manifest endpoint for running integration tests in CI --- .github/docker/simple-server.compose.yml | 1 + .github/workflows/ci_checks.yml | 16 +++++++++++++--- app/src/main/res/xml/network_config.xml | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/docker/simple-server.compose.yml b/.github/docker/simple-server.compose.yml index c4576f81c81..5aa1b6067e3 100644 --- a/.github/docker/simple-server.compose.yml +++ b/.github/docker/simple-server.compose.yml @@ -15,6 +15,7 @@ services: - "6379" server: + container_name: simple-server image: simpledotorg/server:latest command: bash -c "rm -f tmp/pids/server.pid && bundle exec rake db:setup; bundle exec rails s -p 3000 -b '0.0.0.0'" expose: diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index a95a384215b..2c2b14a427a 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -143,6 +143,18 @@ jobs: run: | docker compose -f ".github/docker/simple-server.compose.yml" up -d + - name: Get Docker server IP address + run: | + IP_ADDRESS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' simple-server) + echo "Docker container IP address is: $IP_ADDRESS" + echo "DOCKER_IP=$IP_ADDRESS" >> $GITHUB_ENV + + + - name: Replace IP address in network security config + run: | + sed -i "s/localhost/$DOCKER_IP/g" app/src/main/res/xml/network_config.xml + cat src/main/res/xml/network_config.xml + - name: Cache AVD uses: actions/cache@v4 id: avd-cache @@ -176,10 +188,8 @@ jobs: - name: Build QA Test Artifacts id: build-instrumented-tests - env: - SIMPLE_SERVER_HOST: http://localhost:8420 run: | - ./gradlew --build-cache --no-daemon -PmanifestEndpoint=$SIMPLE_SERVER_HOST/api/ assembleQaDebug assembleQaDebugAndroidTest + ./gradlew --build-cache --no-daemon -PmanifestEndpoint=http://$DOCKER_IP:8420/api/ assembleQaDebug assembleQaDebugAndroidTest - name: QA Android Tests id: run-instrumented-tests diff --git a/app/src/main/res/xml/network_config.xml b/app/src/main/res/xml/network_config.xml index f5dfbe7d47d..6195d19d1cb 100644 --- a/app/src/main/res/xml/network_config.xml +++ b/app/src/main/res/xml/network_config.xml @@ -1,7 +1,7 @@ - + localhost From 002c6aa7c8acbb13d9e2daa4bab8426c5e8a4b25 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Fri, 29 Nov 2024 06:30:46 +0530 Subject: [PATCH 09/10] Wait for docker server to be available after starting it --- .github/scripts/wait_for_docker_server.sh | 28 +++++++++++++++++++++++ .github/workflows/ci_checks.yml | 4 +++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 .github/scripts/wait_for_docker_server.sh diff --git a/.github/scripts/wait_for_docker_server.sh b/.github/scripts/wait_for_docker_server.sh new file mode 100755 index 00000000000..45babb6ba24 --- /dev/null +++ b/.github/scripts/wait_for_docker_server.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +docker network inspect backend + +url="http://localhost:8420" +timeout_in_seconds=3600 # 60 minutes in seconds + +start_time=$(date +%s) + +while true; do + response_code=$(curl -s -o /dev/null -w "%{http_code}" "$url") + + if [ "$response_code" -eq 200 ]; then + echo "Success! Received 200 OK response." + break + else + echo "Failed, got $response_code as response code. Retrying..." + sleep 5 + + current_time=$(date +%s) + elapsed_time=$((current_time - start_time)) + + if [ "$elapsed_time" -ge "$timeout_in_seconds" ]; then + echo "Timeout reached. Exiting." + exit 1 + fi + fi +done diff --git a/.github/workflows/ci_checks.yml b/.github/workflows/ci_checks.yml index 2c2b14a427a..0bdae21c3e7 100644 --- a/.github/workflows/ci_checks.yml +++ b/.github/workflows/ci_checks.yml @@ -143,13 +143,15 @@ jobs: run: | docker compose -f ".github/docker/simple-server.compose.yml" up -d + - name: Wait for Docker server to be available + run: .github/scripts/wait_for_docker_server.sh + - name: Get Docker server IP address run: | IP_ADDRESS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' simple-server) echo "Docker container IP address is: $IP_ADDRESS" echo "DOCKER_IP=$IP_ADDRESS" >> $GITHUB_ENV - - name: Replace IP address in network security config run: | sed -i "s/localhost/$DOCKER_IP/g" app/src/main/res/xml/network_config.xml From c4ac5efa8c2c82b7673353da742d5311fa1ccb17 Mon Sep 17 00:00:00 2001 From: Dany Sam Date: Fri, 6 Dec 2024 14:28:16 +0530 Subject: [PATCH 10/10] Setup CI with remote dockerfile from simple-server (#5152) --- .github/docker/simple-server.compose.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/docker/simple-server.compose.yml b/.github/docker/simple-server.compose.yml index 5aa1b6067e3..9e190437c58 100644 --- a/.github/docker/simple-server.compose.yml +++ b/.github/docker/simple-server.compose.yml @@ -15,8 +15,12 @@ services: - "6379" server: - container_name: simple-server - image: simpledotorg/server:latest + build: + context: https://github.com/simpledotorg/simple-server.git + dockerfile: ./.docker/dev.Dockerfile + image: simple-server:latest + volumes: + - .:/myapp command: bash -c "rm -f tmp/pids/server.pid && bundle exec rake db:setup; bundle exec rails s -p 3000 -b '0.0.0.0'" expose: - "3000"