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