|
84 | 84 | MAVEN_OPTS: -Dmaven.repo.local=${{ runner.temp }}/.m2 |
85 | 85 | run: | |
86 | 86 | echo "Sync the maven dependencies" |
| 87 | + sed -i "s|RUN \./mvnw |RUN --mount=type=cache,target=${{ runner.temp }}/.m2 \./mvnw |g" Dockerfile |
87 | 88 | ./mvnw package -Dmaven.test.skip=true -B dependency:go-offline dependency:resolve-plugins dependency:resolve -q |
88 | | - sed -i 's/RUN \./mvnw /RUN --mount=type=cache,target=${{ runner.temp }}\/.m2 \./mvnw /g' Dockerfile |
89 | 89 | - name: Inject Maven cache into docker |
90 | 90 | uses: reproducible-containers/[email protected] |
91 | 91 | with: |
@@ -203,58 +203,3 @@ jobs: |
203 | 203 | ./.github/utils/cors_check.sh 127.0.0.1 8080 /ors/v2/isochrones/geojson "https://example.org" 200 ${{ matrix.health_wait_time }} |
204 | 204 | # It should fail with http code 403 for https://example.com since the Origin is not covered. |
205 | 205 | ./.github/utils/cors_check.sh 127.0.0.1 8080 /ors/v2/isochrones/geojson "https://example.com" 403 10 |
206 | | -
|
207 | | - test_k8s_image_graph_build: |
208 | | - name: Test k8s image graph build on linux-amd64 |
209 | | - runs-on: ubuntu-latest |
210 | | - needs: |
211 | | - - prepare_environment |
212 | | - - build_docker_images |
213 | | - strategy: |
214 | | - matrix: |
215 | | - platform: [ linux/amd64 ] |
216 | | - # Only test on amd64 for speed; kubernetes image is non-interactive |
217 | | - # so minimal testing needed for other platforms |
218 | | - steps: |
219 | | - - name: Checkout |
220 | | - uses: actions/checkout@v4 |
221 | | - with: |
222 | | - fetch-depth: 0 |
223 | | - - name: Set up Docker Buildx |
224 | | - uses: docker/setup-buildx-action@v3 |
225 | | - - name: Download image artifact |
226 | | - uses: actions/download-artifact@v4 |
227 | | - with: |
228 | | - name: image-linux-amd64-k8s-artifact |
229 | | - path: /tmp/image-artifact |
230 | | - - name: Load image |
231 | | - run: | |
232 | | - docker buildx build --load -t ${{ needs.prepare_environment.outputs.test_k8s_image_name }} /tmp/image-artifact |
233 | | - - name: Get and save the UID |
234 | | - run: | |
235 | | - echo "UID=$(id -u)" >> $GITHUB_ENV |
236 | | - - name: Test k8s image with graph build |
237 | | - run: | |
238 | | - mkdir -p $(pwd)/ors-docker/graphs $(pwd)/ors-docker/config $(pwd)/ors-docker/elevation_cache |
239 | | - chown -R $UID $(pwd)/ors-docker/graphs $(pwd)/ors-docker/config $(pwd)/ors-docker $(pwd)/ors-docker/elevation_cache |
240 | | - # Place cached elevation file |
241 | | - cp ors-api/src/test/files/elevation/srtm_38_03.gh $(pwd)/ors-docker/elevation_cache |
242 | | - # Copy example config for kubernetes image |
243 | | - cp ors-config.yml $(pwd)/ors-docker/config/ors-config.yml |
244 | | - # Start kubernetes image with graph build |
245 | | - docker run -it -d -p 8080:8082 \ |
246 | | - -v $(pwd)/ors-docker/graphs:/home/ors/graphs \ |
247 | | - -v $(pwd)/ors-docker/config:/home/ors/config \ |
248 | | - -v $(pwd)/ors-docker/elevation_cache:/home/ors/elevation_cache \ |
249 | | - -v $(pwd)/ors-api/src/test/files/heidelberg.test.pbf:/home/ors/files/example-heidelberg.test.pbf:ro \ |
250 | | - -e JAVA_OPTS="-server -Xmx8g" \ |
251 | | - -e BUILD_GRAPHS=true \ |
252 | | - -e logging.level.org.heigit=DEBUG \ |
253 | | - --name ors-k8s-test \ |
254 | | - ${{ needs.prepare_environment.outputs.test_k8s_image_name }} |
255 | | - # Wait for graph build and health check (kubernetes image is non-interactive) |
256 | | - timeout 600 bash -c 'until curl -s http://127.0.0.1:8080/ors/v2/health | grep -q "status"; do sleep 5; done' || exit 1 |
257 | | - # Verify service is healthy |
258 | | - curl -s http://127.0.0.1:8080/ors/v2/health | jq . || exit 1 |
259 | | - # Verify graphs were built |
260 | | - [ -f $(pwd)/ors-docker/graphs/driving-car/nodes ] && echo "Graph build verified" || exit 1 |
0 commit comments