mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 04:21:08 +00:00
Make planetiler-openmaptiles runnable as a standalone project (#19)
This commit is contained in:
125
.github/workflows/maven.yml
vendored
125
.github/workflows/maven.yml
vendored
@@ -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
|
||||
34
.github/workflows/performance.yml
vendored
34
.github/workflows/performance.yml
vendored
@@ -26,36 +26,20 @@ jobs:
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
- name: 'Checkout parent Planetiler repo for branch'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: lazaa32/planetiler
|
||||
ref: omt_submodule
|
||||
path: branch/planetiler
|
||||
- name: 'Checkout parent Planetiler repo for base'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: lazaa32/planetiler
|
||||
ref: omt_submodule
|
||||
path: base/planetiler
|
||||
|
||||
- name: 'Checkout PT-OMT PR branch'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: branch/planetiler-openmaptiles
|
||||
- name: 'Move planetiler-openmaptiles into planetiler for base'
|
||||
run: mv branch/planetiler-openmaptiles branch/planetiler
|
||||
path: branch
|
||||
|
||||
- name: 'Checkout PT-OMT base'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: base/planetiler-openmaptiles
|
||||
path: base
|
||||
ref: ${{ github.event.pull_request.base.sha }}
|
||||
- name: 'Move planetiler-openmaptiles into planetiler for base'
|
||||
run: mv base/planetiler-openmaptiles base/planetiler
|
||||
|
||||
- name: 'Cache data/sources'
|
||||
uses: ./branch/planetiler/.github/cache-sources-action
|
||||
uses: ./branch/.github/cache-sources-action
|
||||
with:
|
||||
basedir: branch
|
||||
- name: 'Set up JDK'
|
||||
@@ -71,16 +55,16 @@ jobs:
|
||||
|
||||
- name: 'Build branch'
|
||||
run: ./scripts/build.sh
|
||||
working-directory: branch/planetiler
|
||||
working-directory: branch
|
||||
- name: 'Build base'
|
||||
run: ./scripts/build.sh
|
||||
working-directory: base/planetiler
|
||||
working-directory: base
|
||||
|
||||
- name: 'Download data'
|
||||
run: |
|
||||
set -eo pipefail
|
||||
cp base/planetiler/planetiler-dist/target/*with-deps.jar run.jar && java -jar run.jar --only-download --area="${{ env.AREA }}"
|
||||
cp branch/planetiler/planetiler-dist/target/*with-deps.jar run.jar && java -jar run.jar --only-download --area="${{ env.AREA }}"
|
||||
cp base/target/*with-deps.jar run.jar && java -jar run.jar --only-download --area="${{ env.AREA }}"
|
||||
cp branch/target/*with-deps.jar run.jar && java -jar run.jar --only-download --area="${{ env.AREA }}"
|
||||
|
||||
- name: 'Store build info'
|
||||
run: |
|
||||
@@ -92,14 +76,14 @@ jobs:
|
||||
- name: 'Run branch'
|
||||
run: |
|
||||
rm -rf data/out.mbtiles data/tmp
|
||||
cp branch/planetiler/planetiler-dist/target/*with-deps.jar run.jar
|
||||
cp branch/target/*with-deps.jar run.jar
|
||||
java -Xms${{ env.RAM }} -Xmx${{ env.RAM }} -jar run.jar --area="${{ env.AREA }}" "${{ env.BOUNDS_ARG }}" --mbtiles=data/out.mbtiles 2>&1 | tee log
|
||||
ls -alh run.jar | tee -a log
|
||||
cat log | strip-ansi > build-info/branchlogs.txt
|
||||
- name: 'Run base'
|
||||
run: |
|
||||
rm -rf data/out.mbtiles data/tmp
|
||||
cp base/planetiler/planetiler-dist/target/*with-deps.jar run.jar
|
||||
cp base/target/*with-deps.jar run.jar
|
||||
java -Xms${{ env.RAM }} -Xmx${{ env.RAM }} -jar run.jar --area="${{ env.AREA }}" "${{ env.BOUNDS_ARG }}" --mbtiles=data/out.mbtiles 2>&1 | tee log
|
||||
ls -alh run.jar | tee -a log
|
||||
cat log | strip-ansi > build-info/baselogs.txt
|
||||
|
||||
32
.github/workflows/snapshot.yml
vendored
Normal file
32
.github/workflows/snapshot.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# Publish a docker image on each commit to main
|
||||
name: Publish a Snapshot
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
snapshot:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
- run: |
|
||||
./mvnw -B -ntp -Pjib-multi-arch \
|
||||
-Dimage.tags="latest" \
|
||||
-Djib.to.auth.username="${{ secrets.DOCKERHUB_USERNAME }}" \
|
||||
-Djib.to.auth.password="${{ secrets.DOCKERHUB_PASSWORD }}" \
|
||||
package jib:build --file pom.xml
|
||||
- run: sha256sum target/*with-deps.jar
|
||||
- run: md5sum target/*with-deps.jar
|
||||
- name: 'Upload artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: planetiler-build
|
||||
path: target/*with-deps.jar
|
||||
2
.github/workflows/update-pr.yml
vendored
2
.github/workflows/update-pr.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
https://github.com/onthegomap/planetiler/actions/runs/${{ github.event.workflow_run.id }}
|
||||
https://github.com/openmaptiles/planetiler-openmaptiles/actions/runs/${{ github.event.workflow_run.id }}
|
||||
|
||||
<details><summary>ℹ️ <strong>Base Logs $(cat build-info/base_sha)</strong></summary>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user