Skip to content

Commit

Permalink
Add JDK11 cross compilation (#3435)
Browse files Browse the repository at this point in the history
* Add JDK11 cross compilation

* Fix JDK11 raster tests
  • Loading branch information
pomadchin committed Sep 14, 2023
1 parent ae5e2ca commit b564924
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
18 changes: 17 additions & 1 deletion .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
- HBASE_DOCKER_HOSTNAME=localhost
network_mode: host

test:
test-jdk8:
image: quay.io/azavea/openjdk-gdal:3.1-jdk8-slim
working_dir: /usr/local/src
command: ./sbt ++$SCALA_VERSION test
Expand All @@ -45,3 +45,19 @@ services:
volumes:
- ./../:/usr/local/src
network_mode: host

test-jdk11:
image: quay.io/azavea/openjdk-gdal:3.1-jdk11-slim
working_dir: /usr/local/src
command: ./sbt ++$SCALA_VERSION test
environment:
- CI
- SCALA_VERSION
depends_on:
- nginx
- minio
- cassandra
- hbase
volumes:
- ./../:/usr/local/src
network_mode: host
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,37 @@ on:
push:
branches: ['master']
tags: [v*]
# release:
# types: [published]

jobs:
build:
name: Build and Test
strategy:
matrix:
scala: ["2.12.17", "2.13.10"]
java: ["8", "11"]
runs-on: ubuntu-latest

env:
SCALA_VERSION: ${{ matrix.scala }}
JAVA_VERSION: ${{ matrix.java }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: coursier/cache-action@v6
# - uses: olafurpg/setup-scala@v13
# with:
# java-version: adopt@1.8

- name: unzip rasters
run: cd raster/data; unzip geotiff-test-files.zip

- name: run tests
run: docker compose -f .github/docker-compose.yml up test --abort-on-container-exit --exit-code-from test
run: |
if [[ "$JAVA_VERSION" == "8" ]]; then
docker compose -f .github/docker-compose.yml up test-jdk8 --abort-on-container-exit --exit-code-from test-jdk8
elif [[ "$JAVA_VERSION" == "11" ]]; then
docker compose -f .github/docker-compose.yml up test-jdk11 --abort-on-container-exit --exit-code-from test-jdk11
fi
publish:
name: Publish Artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class RenderPngTests extends AnyFunSuite with Matchers with TileBuilders with Ra
val stops = Array(10000, 20000, 30000, 40000, 50000, 60000, 70000)
val colorMap = ColorMap(stops, ramp)

val greyPng = colorMap.render(tile).map(z => z >> 8 & 0xFF).renderPng(GreyPngEncoding(0x00))
val greyPng = colorMap.render(tile).map(z => z >> 8 & 0xFF).renderPng(GreyPngEncoding)
val greyaPng = colorMap.render(tile).map(z => (z & 0xFF00) | 0xFF).renderPng(GreyaPngEncoding)

val greyImg = ImageIO.read(new ByteArrayInputStream(greyPng))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ class ReprojectSpec extends AnyFunSpec
val raster = geoTiff.raster.reproject(geoTiff.crs, WebMercator)

geoTiff.crs.toProj4String should be ("+proj=cea +lat_ts=33.75 +lon_0=-117.333333333333 +x_0=0.0 +y_0=0.0 +datum=NAD27 +units=m ")
raster.extent should be (Extent(-1.3095719172012957E7, 3983866.9277966353, -1.305868719072902E7, 4021260.5495227976))

// raster.extent should be (Extent(-1.3095719172012957E7, 3983866.9277966353, -1.305868719072902E7, 4021260.5495227976))
raster.extent.xmin should be (-1.3095719172012957E7 +- 1e-7)
raster.extent.ymin should be (3983866.9277966353 +- 1e-7)
raster.extent.xmax should be (-1.305868719072902E7 +- 1e-7)
raster.extent.ymax should be (4021260.5495227976 +- 1e-7)

raster.dimensions shouldBe Dimensions(512, 517)
}
}
Expand Down

0 comments on commit b564924

Please sign in to comment.