Make planetiler-openmaptiles runnable as a standalone project (#19)

This commit is contained in:
Michael Barry
2022-08-02 07:07:41 -04:00
committed by GitHub
parent 62d420811b
commit 0d7cd887ce
75 changed files with 2560 additions and 454 deletions

View File

@@ -15,18 +15,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout parent Planetiler repo
uses: actions/checkout@v3
with:
repository: lazaa32/planetiler
ref: omt_submodule
path: planetiler
- name: Checkout this PR planetiler-openmaptiles repo
uses: actions/checkout@v3
with:
path: planetiler-openmaptiles
- name: Move planetiler-openmaptiles into planetiler
run: mv planetiler-openmaptiles planetiler
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
@@ -34,7 +24,6 @@ jobs:
distribution: 'temurin'
cache: 'maven'
- name: Ensure code formatted with mvn spotless:apply
working-directory: planetiler
run: ./mvnw -DskipTests --batch-mode -no-transfer-progress spotless:check
build:
@@ -56,22 +45,8 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- name: Checkout parent Planetiler repo
uses: actions/checkout@v3
with:
repository: lazaa32/planetiler
ref: omt_submodule
path: planetiler
- name: Checkout this PR planetiler-openmaptiles repo
uses: actions/checkout@v3
with:
path: planetiler-openmaptiles
- name: Move planetiler-openmaptiles into planetiler (linux/mac)
if: ${{ !contains(matrix.os, 'windows') }}
run: mv planetiler-openmaptiles planetiler
- name: Move planetiler-openmaptiles into planetiler (windows)
if: ${{ contains(matrix.os, 'windows') }}
run: mv -Force planetiler-openmaptiles planetiler
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
@@ -81,11 +56,9 @@ jobs:
# Skip spotless since that gets checked in a separate task
- name: Build with mvnw (linux/mac)
if: ${{ !contains(matrix.os, 'windows') }}
working-directory: planetiler
run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
- name: Build with mvnw.cmd (windows)
if: ${{ contains(matrix.os, 'windows') }}
working-directory: planetiler
run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
shell: cmd
@@ -94,18 +67,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout parent Planetiler repo
uses: actions/checkout@v3
with:
repository: lazaa32/planetiler
ref: omt_submodule
path: planetiler
- name: Checkout this PR planetiler-openmaptiles repo
uses: actions/checkout@v3
with:
path: planetiler-openmaptiles
- name: Move planetiler-openmaptiles into planetiler
run: mv planetiler-openmaptiles planetiler
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
@@ -113,59 +76,48 @@ jobs:
distribution: 'temurin'
cache: 'maven'
- run: ./scripts/regenerate-openmaptiles.sh
working-directory: planetiler
# Skip spotless since that gets checked in a separate task
- run: ./mvnw -Dspotless.check.skip -DskipTests --batch-mode -no-transfer-progress clean install -pl planetiler-openmaptiles -am
working-directory: planetiler
- run: ./mvnw -Dspotless.check.skip --batch-mode -no-transfer-progress verify -pl planetiler-openmaptiles
working-directory: planetiler
examples:
name: Example project
runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true
steps:
- name: Checkout parent Planetiler repo
uses: actions/checkout@v3
with:
repository: lazaa32/planetiler
ref: omt_submodule
path: planetiler
- name: Checkout this PR planetiler-openmaptiles repo
uses: actions/checkout@v3
with:
path: planetiler-openmaptiles
- name: Move planetiler-openmaptiles into planetiler
run: mv planetiler-openmaptiles planetiler
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Build and test
run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml
working-directory: planetiler/planetiler-examples
- name: Find jar
run: mv target/*with-deps.jar ./run.jar
working-directory: planetiler/planetiler-examples
- name: Run
run: java -jar run.jar --osm-path=../planetiler-core/src/test/resources/monaco-latest.osm.pbf --mbtiles=data/out.mbtiles
working-directory: planetiler/planetiler-examples
- name: Verify
run: java -cp run.jar com.onthegomap.planetiler.mbtiles.Verify data/out.mbtiles
working-directory: planetiler/planetiler-examples
- run: ./mvnw -Dspotless.check.skip --batch-mode -no-transfer-progress clean verify
run:
name: Build / Run
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout this PR planetiler-openmaptiles repo
uses: actions/checkout@v3
- name: Cache data/sources
uses: ./.github/cache-sources-action
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build this branch
run: ./mvnw -DskipTests -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress package jib:dockerBuild --file pom.xml
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
with:
name: planetiler-build
path: target/*with-deps.jar
- name: 'Download data (java)'
run: java -jar target/*with-deps.jar --only-download --area=monaco
- name: 'Download wikidata (java)'
run: java -jar target/*with-deps.jar --only-fetch-wikidata --area=monaco
- name: 'Verify build'
run: ./scripts/test-release.sh CI_ONLY
submodule:
name: Planetiler submodule
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout parent Planetiler repo
uses: actions/checkout@v3
with:
repository: lazaa32/planetiler
ref: omt_submodule
repository: onthegomap/planetiler
ref: main
path: planetiler
- name: Checkout this PR planetiler-openmaptiles repo
uses: actions/checkout@v3
@@ -174,21 +126,16 @@ jobs:
- name: Move planetiler-openmaptiles into planetiler
run: mv planetiler-openmaptiles planetiler
- name: Cache data/sources
uses: ./planetiler/.github/cache-sources-action
uses: ./planetiler/planetiler-openmaptiles/.github/cache-sources-action
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build this branch
- name: Build and test this branch
working-directory: planetiler
run: ./mvnw -DskipTests -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress package jib:dockerBuild --file pom.xml
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
with:
name: planetiler-build
path: planetiler/planetiler-dist/target/*with-deps.jar
run: ./mvnw -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress verify package jib:dockerBuild --file pom.xml
- name: 'Download data (java)'
working-directory: planetiler
run: java -jar planetiler-dist/target/*with-deps.jar --only-download --area=monaco
@@ -199,4 +146,4 @@ jobs:
working-directory: planetiler
run: ./scripts/test-release.sh CI_ONLY
env:
SKIP_EXAMPLE_PROJECT: true
SKIP_EXAMPLE_PROJECT: true