File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ services:
15
15
- " 6379"
16
16
17
17
server :
18
+ container_name : simple-server
18
19
image : simpledotorg/server:latest
19
20
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'"
20
21
expose :
Original file line number Diff line number Diff line change @@ -143,6 +143,15 @@ jobs:
143
143
run : |
144
144
docker compose -f ".github/docker/simple-server.compose.yml" up -d
145
145
146
+ - name : Get Docker server IP address
147
+ run : |
148
+ IP_ADDRESS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' simple-server)
149
+ echo "Docker container IP address is: $IP_ADDRESS"
150
+ echo "DOCKER_IP=$IP_ADDRESS" >> $GITHUB_ENV
151
+
152
+ - name : Replace IP address in network security config
153
+ run : sed -i 's/localhost/$DOCKER_IP/g' app/src/main/res/xml/network_config.xml
154
+
146
155
- name : Cache AVD
147
156
uses : actions/cache@v4
148
157
id : avd-cache
@@ -176,10 +185,8 @@ jobs:
176
185
177
186
- name : Build QA Test Artifacts
178
187
id : build-instrumented-tests
179
- env :
180
- SIMPLE_SERVER_HOST : http://10.0.2.2:8420
181
188
run : |
182
- ./gradlew --build-cache --no-daemon -PmanifestEndpoint=$SIMPLE_SERVER_HOST /api/ assembleQaDebug assembleQaDebugAndroidTest
189
+ ./gradlew --build-cache --no-daemon -PmanifestEndpoint=http://$DOCKER_IP:8420 /api/ assembleQaDebug assembleQaDebugAndroidTest
183
190
184
191
- name : QA Android Tests
185
192
id : run-instrumented-tests
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<network-security-config >
3
3
<domain-config cleartextTrafficPermitted =" true" >
4
- <!-- We use this local host and port for our integration tests in CI -->
5
- <domain includeSubdomains =" true" >10.0.2.2 </domain >
4
+ <!-- We replace the localhost with Docker container IP address during CI -->
5
+ <domain includeSubdomains =" true" >localhost </domain >
6
6
</domain-config >
7
7
</network-security-config >
You can’t perform that action at this time.
0 commit comments