mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 12:31:10 +00:00
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
141 lines
5.1 KiB
YAML
141 lines
5.1 KiB
YAML
# This workflow will build a Java project with Maven
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
|
|
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
# When spotless:apply fails, the error message is a bit cryptic, so try to make it obvious that
|
|
# is the problem by putting the check into a standalone job
|
|
lint:
|
|
name: Check formatting
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout this PR planetiler-openmaptiles repo
|
|
uses: actions/checkout@v4
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 21
|
|
distribution: 'temurin'
|
|
cache: 'maven'
|
|
- name: Ensure code formatted with mvn spotless:apply
|
|
run: ./mvnw -DskipTests --batch-mode -no-transfer-progress spotless:check
|
|
|
|
build:
|
|
name: Java ${{ matrix.jdk }} / ${{ matrix.os }} ${{ matrix.args }}
|
|
# Wait until after we check that you ran mvn spotless:apply, otherwise will fail with a cryptic error message
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
|
jdk: [ 21 ]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout this PR planetiler-openmaptiles repo
|
|
uses: actions/checkout@v4
|
|
- name: Set up JDK ${{ matrix.jdk }}
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: ${{ matrix.jdk }}
|
|
distribution: 'temurin'
|
|
cache: 'maven'
|
|
# Skip spotless since that gets checked in a separate task
|
|
- name: Build with mvnw (linux/mac)
|
|
if: ${{ !contains(matrix.os, 'windows') }}
|
|
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') }}
|
|
run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
|
|
shell: cmd
|
|
|
|
regenerate:
|
|
name: Regenerate
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout this PR planetiler-openmaptiles repo
|
|
uses: actions/checkout@v4
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 21
|
|
distribution: 'temurin'
|
|
cache: 'maven'
|
|
- run: ./scripts/regenerate-openmaptiles.sh
|
|
# Skip spotless since that gets checked in a separate task
|
|
- 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@v4
|
|
- name: Cache data/sources
|
|
uses: ./.github/cache-sources-action
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 21
|
|
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@v4
|
|
with:
|
|
repository: onthegomap/planetiler
|
|
ref: main
|
|
path: planetiler
|
|
- name: Checkout this PR planetiler-openmaptiles repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: planetiler-openmaptiles
|
|
- name: Move planetiler-openmaptiles into planetiler
|
|
run: mv planetiler-openmaptiles planetiler
|
|
- name: Cache data/sources
|
|
uses: ./planetiler/planetiler-openmaptiles/.github/cache-sources-action
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 21
|
|
distribution: 'temurin'
|
|
cache: 'maven'
|
|
- name: Build and test this branch
|
|
working-directory: planetiler
|
|
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
|
|
- name: 'Download wikidata (java)'
|
|
working-directory: planetiler
|
|
run: java -jar planetiler-dist/target/*with-deps.jar --only-fetch-wikidata --area=monaco
|
|
- name: 'Verify build'
|
|
working-directory: planetiler
|
|
run: ./scripts/test-release.sh CI_ONLY
|
|
env:
|
|
SKIP_EXAMPLE_PROJECT: true |