Merge branch 'master' into svg-group-render
This commit is contained in:
commit
6afcb73135
10 changed files with 309 additions and 537 deletions
90
.github/actions/run_tests/action.yml
vendored
Normal file
90
.github/actions/run_tests/action.yml
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
name: "Run tests with coverage"
|
||||
description: "Runs all mapnik tests with coverage"
|
||||
inputs:
|
||||
cmake-preset:
|
||||
description: "the used cmake preset"
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set proj enviroment
|
||||
shell: "pwsh"
|
||||
run: |
|
||||
$out = cmake --preset ${{ inputs.cmake-preset }} -N -L
|
||||
$proj_lib = $out -match "PROJ_LIB=*"
|
||||
echo ("PROJ_LIB=" + $proj_lib.Substring(11)) >> $env:GITHUB_ENV
|
||||
|
||||
- name: Test
|
||||
shell: "bash"
|
||||
env:
|
||||
UPDATE: "1"
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||
OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --cover_children -- ctest --preset ${{ inputs.cmake-preset }}
|
||||
else
|
||||
ctest --preset ${{ inputs.cmake-preset }}
|
||||
fi
|
||||
|
||||
- name: Test visuals (windows)
|
||||
continue-on-error: true
|
||||
working-directory: build/${{ inputs.cmake-preset }}/out
|
||||
shell: "pwsh"
|
||||
if: runner.os == 'Windows'
|
||||
run: OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --input_coverage=${{ github.workspace }}/ctest.cov --cover_children -- .\mapnik-test-visual.exe -j (Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors --output-dir ./visual-test-result
|
||||
|
||||
- name: Test visuals (linux & mac)
|
||||
continue-on-error: true
|
||||
working-directory: build/${{ inputs.cmake-preset }}/out
|
||||
shell: "bash"
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||
./mapnik-test-visual -j $(nproc) --output-dir ./visual-test-result
|
||||
else
|
||||
./mapnik-test-visual -j $(sysctl -n hw.logicalcpu) --output-dir ./visual-test-result
|
||||
fi
|
||||
|
||||
- name: Pack visual test results
|
||||
working-directory: build/${{ inputs.cmake-preset }}/out
|
||||
shell: "pwsh"
|
||||
run: tar cfvz visual-test-results.tar.gz ./visual-test-result
|
||||
|
||||
- name: Generate run guid
|
||||
id: run-guid
|
||||
shell: "pwsh"
|
||||
run: |
|
||||
$guid = New-Guid
|
||||
echo ("GUID=" + $guid.toString()) >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Upload visual test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.cmake-preset }}-visual-tests-${{ steps.run-guid.outputs.GUID }}
|
||||
path: build/${{ inputs.cmake-preset }}/out/visual-test-results.tar.gz
|
||||
|
||||
- name: Run Benchmarks
|
||||
working-directory: build/${{ inputs.cmake-preset }}/out
|
||||
if: runner.os != 'Windows'
|
||||
shell: "pwsh"
|
||||
run: ./run_benchmarks
|
||||
|
||||
- name: Collect coverage (linux & macos)
|
||||
working-directory: build/${{ inputs.cmake-preset }}
|
||||
if: runner.os != 'Windows'
|
||||
shell: "bash"
|
||||
run: |
|
||||
lcov --directory . --capture --output-file coverage.info
|
||||
lcov --remove coverage.info '/usr/*' '*/vcpkg_installed/*' '/.cache/*' '*/test/*' --output-file coverage.info
|
||||
lcov --list coverage.info
|
||||
|
||||
- name: Upload coverage to Codecov (linux & macos)
|
||||
if: runner.os != 'Windows'
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: build/${{ inputs.cmake-preset }}/coverage.info
|
||||
|
||||
- name: Upload coverage to Codecov (windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: build/${{ inputs.cmake-preset }}/out/mapnik-test-visual.cov
|
50
.github/actions/setup_vcpkg/action.yml
vendored
Normal file
50
.github/actions/setup_vcpkg/action.yml
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
name: "Setup vcpkg"
|
||||
description: "Sets up vcpkg"
|
||||
inputs:
|
||||
vcpkg-sha:
|
||||
description: "vcpkg git sha to use"
|
||||
required: true
|
||||
nuget-source:
|
||||
description: "The nuget json"
|
||||
required: true
|
||||
nuget-username:
|
||||
description: "The username for the nuget repository"
|
||||
required: true
|
||||
nuget-pat:
|
||||
description: "The PAT for the nuget repository"
|
||||
required: true
|
||||
mono:
|
||||
description: "mono exec"
|
||||
required: true
|
||||
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: checkout vcpkg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "microsoft/vcpkg"
|
||||
ref: ${{ inputs.vcpkg-sha }}
|
||||
path: vcpkg
|
||||
|
||||
- name: "Setup vcpkg"
|
||||
shell: bash
|
||||
run: ./vcpkg/bootstrap-vcpkg.sh
|
||||
|
||||
- name: "Setup NuGet Credentials"
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ inputs.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.nuget-source }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ inputs.nuget-username }}"
|
||||
-password "${{ inputs.nuget-pat }}"
|
||||
|
||||
- name: "Setup NuGet apikey"
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ inputs.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ inputs.nuget-pat }}" -Source "${{ inputs.nuget-source }}"
|
93
.github/workflows/build_and_test.yml
vendored
Normal file
93
.github/workflows/build_and_test.yml
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- "no-ci-*"
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
|
||||
VCPKG_NUGET_REPOSITORY: https://github.com/mathisloge/vcpkg-nuget.git
|
||||
|
||||
jobs:
|
||||
checkSource:
|
||||
name: Check Source Code
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
|
||||
buildAndTest:
|
||||
name: Build and Test
|
||||
needs: checkSource
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
memory-mapped: ["OFF", "ON"]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
mono: mono
|
||||
- os: macos-latest
|
||||
mono: mono
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: "Install required system packages"
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||
choco install ninja OpenCppCoverage
|
||||
echo "C:\Program Files\OpenCppCoverage" >> ${GITHUB_PATH}
|
||||
elif [ "$RUNNER_OS" == "Linux" ]; then
|
||||
sudo apt update
|
||||
sudo apt install -y gperf libxxf86vm-dev ninja-build postgresql-client lcov autoconf-archive
|
||||
else
|
||||
brew install automake ninja lcov autoconf-archive
|
||||
fi
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
if: runner.os == 'Windows'
|
||||
|
||||
- name: checkout mapnik
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: setup vcpkg
|
||||
uses: ./.github/actions/setup_vcpkg
|
||||
with:
|
||||
vcpkg-sha: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
nuget-source: https://nuget.pkg.github.com/mapnik/index.json
|
||||
nuget-username: ${{ github.actor }}
|
||||
nuget-pat: ${{ secrets.GITHUB_TOKEN }}
|
||||
mono: ${{ matrix.mono }}
|
||||
|
||||
- id: lc_platform
|
||||
uses: ASzc/change-string-case-action@v5
|
||||
with:
|
||||
string: ${{ runner.os }}
|
||||
|
||||
- name: set lower case runner os
|
||||
shell: "bash"
|
||||
run: |
|
||||
echo "PRESET=${{ steps.lc_platform.outputs.lowercase }}-ci" >>${GITHUB_ENV}
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ matrix.memory-mapped }} --preset ${{ env.PRESET }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build --preset ${{ env.PRESET }}
|
||||
|
||||
- name: Run Tests
|
||||
uses: ./.github/actions/run_tests
|
||||
with:
|
||||
cmake-preset: ${{ env.PRESET }}
|
91
.github/workflows/build_test.yml
vendored
91
.github/workflows/build_test.yml
vendored
|
@ -1,91 +0,0 @@
|
|||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- "no-ci-*"
|
||||
|
||||
jobs:
|
||||
checkSource:
|
||||
name: Check Source Code
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: pre-commit/action@v3.0.0
|
||||
|
||||
windows:
|
||||
needs: checkSource
|
||||
name: Windows memory mapped
|
||||
uses: ./.github/workflows/windows.yml
|
||||
with:
|
||||
VCPKG_SHA: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
|
||||
NUGET_USERNAME: mapnik
|
||||
USE_MEMORY_MAPPED_FILE: "ON"
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
|
||||
|
||||
windows-mmf-off:
|
||||
needs: checkSource
|
||||
name: Windows file based
|
||||
uses: ./.github/workflows/windows.yml
|
||||
with:
|
||||
VCPKG_SHA: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
|
||||
NUGET_USERNAME: mapnik
|
||||
USE_MEMORY_MAPPED_FILE: "OFF"
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
|
||||
|
||||
ubuntu:
|
||||
needs: checkSource
|
||||
name: Linux memory mapped
|
||||
uses: ./.github/workflows/ubuntu.yml
|
||||
with:
|
||||
VCPKG_SHA: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
|
||||
NUGET_USERNAME: mapnik
|
||||
USE_MEMORY_MAPPED_FILE: "ON"
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
|
||||
|
||||
ubuntu-mmf-off:
|
||||
needs: checkSource
|
||||
name: Linux file based
|
||||
uses: ./.github/workflows/ubuntu.yml
|
||||
with:
|
||||
VCPKG_SHA: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
|
||||
NUGET_USERNAME: mapnik
|
||||
USE_MEMORY_MAPPED_FILE: "OFF"
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
|
||||
|
||||
macos:
|
||||
needs: checkSource
|
||||
name: MacOS memory mapped
|
||||
uses: ./.github/workflows/macos.yml
|
||||
with:
|
||||
VCPKG_SHA: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
|
||||
NUGET_USERNAME: mapnik
|
||||
USE_MEMORY_MAPPED_FILE: "ON"
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
|
||||
|
||||
macos-mmf-off:
|
||||
needs: checkSource
|
||||
name: MacOS file based
|
||||
uses: ./.github/workflows/macos.yml
|
||||
with:
|
||||
VCPKG_SHA: 34d2cf7e62d781f4bcb9c7f44f4d2389f568e92b
|
||||
NUGET_REGISTRY: https://nuget.pkg.github.com/mapnik/index.json
|
||||
NUGET_USERNAME: mapnik
|
||||
USE_MEMORY_MAPPED_FILE: "OFF"
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT: ${{ secrets.VCPKG_CACHE_PAT }}
|
146
.github/workflows/macos.yml
vendored
146
.github/workflows/macos.yml
vendored
|
@ -1,146 +0,0 @@
|
|||
name: MacOS
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
VCPKG_SHA:
|
||||
required: true
|
||||
type: string
|
||||
NUGET_REGISTRY:
|
||||
required: true
|
||||
type: string
|
||||
NUGET_USERNAME:
|
||||
required: true
|
||||
type: string
|
||||
USE_MEMORY_MAPPED_FILE:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT:
|
||||
required: true
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
|
||||
VCPKG_NUGET_REPOSITORY: https://github.com/mapnik/vcpkg-cache.git
|
||||
UPDATE: 1
|
||||
preset: macos-ci
|
||||
mono: mono
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install required system packages
|
||||
run: |
|
||||
brew install automake ninja lcov autoconf-archive
|
||||
|
||||
- name: checkout mapnik
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: checkout vcpkg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "microsoft/vcpkg"
|
||||
ref: ${{ inputs.VCPKG_SHA }}
|
||||
path: vcpkg
|
||||
|
||||
- name: "Setup vcpkg"
|
||||
shell: bash
|
||||
run: ./vcpkg/bootstrap-vcpkg.sh
|
||||
|
||||
- name: "Setup NuGet Credentials"
|
||||
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.NUGET_REGISTRY }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ inputs.NUGET_USERNAME }}"
|
||||
-password "${{ secrets.NUGET_REGISTRY_PAT }}"
|
||||
|
||||
- name: "Setup NuGet apikey"
|
||||
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ secrets.NUGET_REGISTRY_PAT }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
||||
|
||||
- name: "Setup NuGet Credentials READONLY"
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.NUGET_REGISTRY }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ github.actor }}"
|
||||
-password "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: "Setup NuGet apikey READONLY"
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset=${{ env.preset }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build --preset ${{ env.preset }}
|
||||
|
||||
- name: Test
|
||||
run: ctest --preset ${{ env.preset }}
|
||||
|
||||
- name: Test visuals
|
||||
continue-on-error: true
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
env:
|
||||
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-osx/share/proj
|
||||
run: ./mapnik-test-visual -j $(sysctl -n hw.logicalcpu) --output-dir ./visual-test-result
|
||||
|
||||
- name: Pack visual test results
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
run: tar cfvz visual-test-results.tar.gz ./visual-test-result
|
||||
|
||||
- name: Run Benchmark
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
env:
|
||||
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-osx/share/proj
|
||||
run: ./run_benchmarks
|
||||
|
||||
- name: Coverage
|
||||
working-directory: build/${{ env.preset }}
|
||||
run: |
|
||||
lcov --directory . --capture --output-file coverage.info
|
||||
lcov --remove coverage.info '/usr/*' '*/vcpkg_installed/*' '/.cache/*' '*/test/*' --output-file coverage.info
|
||||
lcov --list coverage.info
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
files: build/${{ env.preset }}/coverage.info
|
||||
|
||||
- name: Package
|
||||
if: failure()
|
||||
run: cmake --build --preset ${{ env.preset }} --target package
|
||||
|
||||
- name: Upload mapnik build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ env.preset }}-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }}
|
||||
path: build/${{ env.preset }}/mapnik-*.tar.gz
|
||||
retention-days: 2
|
||||
|
||||
- name: Upload visual test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.preset }}-visual-tests-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }}
|
||||
path: build/${{ env.preset }}/out/visual-test-results.tar.gz
|
||||
retention-days: 2
|
55
.github/workflows/release_linux.yml
vendored
Normal file
55
.github/workflows/release_linux.yml
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
name: Release Linux
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- "no-ci-*"
|
||||
env:
|
||||
PRESET: linux-ci-release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: "ubuntu-22.04"
|
||||
steps:
|
||||
|
||||
- name: checkout mapnik
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: "Install required system packages"
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y ninja-build\
|
||||
libicu-dev \
|
||||
libfreetype6-dev \
|
||||
libharfbuzz-dev \
|
||||
libxml2-dev \
|
||||
libjpeg-dev \
|
||||
libtiff-dev \
|
||||
libwebp-dev \
|
||||
libcairo2-dev \
|
||||
libproj-dev \
|
||||
libgdal-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-regex-dev
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake --preset ${{ env.PRESET }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build --preset ${{ env.PRESET }}
|
||||
|
||||
- name: Package
|
||||
run: cmake --build --preset ${{ env.PRESET }} --target package
|
||||
|
||||
- name: Upload mapnik debian package
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.PRESET }}-deb
|
||||
path: build/${{ env.PRESET }}/mapnik-*.deb
|
162
.github/workflows/ubuntu.yml
vendored
162
.github/workflows/ubuntu.yml
vendored
|
@ -1,162 +0,0 @@
|
|||
name: Ubuntu
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
VCPKG_SHA:
|
||||
required: true
|
||||
type: string
|
||||
NUGET_REGISTRY:
|
||||
required: true
|
||||
type: string
|
||||
NUGET_USERNAME:
|
||||
required: true
|
||||
type: string
|
||||
USE_MEMORY_MAPPED_FILE:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT:
|
||||
required: true
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
|
||||
VCPKG_NUGET_REPOSITORY: https://github.com/mapnik/vcpkg-cache.git
|
||||
UPDATE: 1
|
||||
preset: linux-ci
|
||||
mono: mono
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgis/postgis
|
||||
env:
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: mapnik-tmp-postgis-test-db
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Install required system packages
|
||||
shell: "bash"
|
||||
run: |
|
||||
sudo apt-get install -y gperf libxxf86vm-dev ninja-build postgresql-client lcov autoconf-archive
|
||||
|
||||
- name: checkout mapnik
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: checkout vcpkg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "microsoft/vcpkg"
|
||||
ref: ${{ inputs.VCPKG_SHA }}
|
||||
path: vcpkg
|
||||
|
||||
- name: "Setup vcpkg"
|
||||
shell: bash
|
||||
run: ./vcpkg/bootstrap-vcpkg.sh
|
||||
|
||||
- name: "Setup NuGet Credentials"
|
||||
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.NUGET_REGISTRY }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ inputs.NUGET_USERNAME }}"
|
||||
-password "${{ secrets.NUGET_REGISTRY_PAT }}"
|
||||
|
||||
- name: "Setup NuGet apikey"
|
||||
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ secrets.NUGET_REGISTRY_PAT }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
||||
|
||||
- name: "Setup NuGet Credentials READONLY"
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.NUGET_REGISTRY }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ github.actor }}"
|
||||
-password "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: "Setup NuGet apikey READONLY"
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset=${{ env.preset }}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build --preset ${{ env.preset }}
|
||||
|
||||
- name: Test
|
||||
run: ctest --preset ${{ env.preset }}
|
||||
|
||||
- name: Test visuals
|
||||
continue-on-error: true
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
env:
|
||||
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj
|
||||
run: ./mapnik-test-visual -j $(nproc) --output-dir ./visual-test-result
|
||||
|
||||
- name: Pack visual test results
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
run: tar cfvz visual-test-results.tar.gz ./visual-test-result
|
||||
|
||||
- name: Run Benchmarks
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
env:
|
||||
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj
|
||||
run: ./run_benchmarks
|
||||
|
||||
- name: Coverage
|
||||
working-directory: build/${{ env.preset }}
|
||||
run: |
|
||||
lcov --directory . --capture --output-file coverage.info
|
||||
lcov --remove coverage.info '/usr/*' '*/vcpkg_installed/*' '/.cache/*' '*/test/*' --output-file coverage.info
|
||||
lcov --list coverage.info
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
files: build/${{ env.preset }}/coverage.info
|
||||
|
||||
- name: Package
|
||||
if: failure()
|
||||
run: cmake --build --preset ${{ env.preset }} --target package
|
||||
|
||||
- name: Upload mapnik build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ env.preset }}-artifact-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }}
|
||||
path: build/${{ env.preset }}/mapnik-*.tar.gz
|
||||
retention-days: 2
|
||||
|
||||
- name: Upload visual test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.preset }}-visual-tests-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }}
|
||||
path: build/${{ env.preset }}/out/visual-test-results.tar.gz
|
||||
retention-days: 2
|
135
.github/workflows/windows.yml
vendored
135
.github/workflows/windows.yml
vendored
|
@ -1,135 +0,0 @@
|
|||
name: Windows
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
VCPKG_SHA:
|
||||
required: true
|
||||
type: string
|
||||
NUGET_REGISTRY:
|
||||
required: true
|
||||
type: string
|
||||
NUGET_USERNAME:
|
||||
required: true
|
||||
type: string
|
||||
USE_MEMORY_MAPPED_FILE:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
NUGET_REGISTRY_PAT:
|
||||
required: true
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
|
||||
VCPKG_NUGET_REPOSITORY: https://github.com/mapnik/vcpkg-cache.git
|
||||
UPDATE: 1
|
||||
preset: windows-ci
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Install required system packages
|
||||
run: |
|
||||
choco install ninja OpenCppCoverage
|
||||
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: checkout mapnik
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: checkout vcpkg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "microsoft/vcpkg"
|
||||
ref: ${{ inputs.VCPKG_SHA }}
|
||||
path: vcpkg
|
||||
|
||||
- name: "Setup vcpkg"
|
||||
run: ./vcpkg/bootstrap-vcpkg.bat
|
||||
|
||||
- name: "Setup NuGet Credentials"
|
||||
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
`./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.NUGET_REGISTRY }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ inputs.NUGET_USERNAME }}"
|
||||
-password "${{ secrets.NUGET_REGISTRY_PAT }}"
|
||||
|
||||
- name: "Setup NuGet apikey"
|
||||
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
`./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ secrets.NUGET_REGISTRY_PAT }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
||||
|
||||
- name: "Setup NuGet Credentials READONLY"
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
`./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
sources add
|
||||
-source "${{ inputs.NUGET_REGISTRY }}"
|
||||
-storepasswordincleartext
|
||||
-name "GitHub"
|
||||
-username "${{ github.actor }}"
|
||||
-password "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: "Setup NuGet apikey READONLY"
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
||||
shell: "bash"
|
||||
run: >
|
||||
`./vcpkg/vcpkg fetch nuget | tail -n 1`
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} --preset ${{env.preset}}
|
||||
|
||||
- name: Build
|
||||
run: cmake --build --preset ${{env.preset}}
|
||||
|
||||
- name: Test
|
||||
run: OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --cover_children -- ctest --preset ${{env.preset}}
|
||||
|
||||
- name: Test visuals
|
||||
shell: pwsh
|
||||
continue-on-error: true
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
env:
|
||||
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-windows/share/proj
|
||||
run: OpenCppCoverage --modules *libmapnik* --modules mapnik*.exe --modules *.input --sources ${{ github.workspace }} --export_type binary --input_coverage=${{ github.workspace }}/ctest.cov --cover_children -- .\mapnik-test-visual.exe -j (Get-CimInstance -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors --output-dir ./visual-test-result
|
||||
|
||||
- name: Pack visual test results
|
||||
working-directory: build/${{ env.preset }}/out
|
||||
run: tar cfvz visual-test-results.tar.gz ./visual-test-result
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v2
|
||||
with:
|
||||
files: build/${{ env.preset }}/out/mapnik-test-visual.cov
|
||||
|
||||
- name: Package
|
||||
if: failure()
|
||||
run: cmake --build --preset ${{env.preset}} --target package
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ env.preset }}-artifact-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }}
|
||||
path: build/*-ci/mapnik-*.tar.gz
|
||||
retention-days: 2
|
||||
|
||||
- name: Upload visual test results
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.preset }}-visual-tests-mmio-${{ inputs.USE_MEMORY_MAPPED_FILE }}
|
||||
path: build/${{ env.preset }}/out/visual-test-results.tar.gz
|
||||
retention-days: 2
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"version": 2,
|
||||
"version": 6,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 20,
|
||||
"minor": 25,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
|
@ -213,6 +213,19 @@
|
|||
"PROJ_LIB": "${sourceDir}/build/${presetName}/vcpkg_installed/x64-linux/share/proj"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-ci-release",
|
||||
"description": "used by the ci pipeline for releasing",
|
||||
"inherits": [
|
||||
"release-build",
|
||||
"linux-gcc-release"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"BUILD_TESTING": "OFF",
|
||||
"BUILD_DEMO_VIEWER": "OFF",
|
||||
"USE_MEMORY_MAPPED_FILE": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "macos-ci",
|
||||
"description": "used by the ci pipeline",
|
||||
|
@ -263,6 +276,10 @@
|
|||
"name": "linux-ci",
|
||||
"configurePreset": "linux-ci"
|
||||
},
|
||||
{
|
||||
"name": "linux-ci-release",
|
||||
"configurePreset": "linux-ci-release"
|
||||
},
|
||||
{
|
||||
"name": "macos-ci",
|
||||
"configurePreset": "macos-ci"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
include(InstallRequiredSystemLibraries)
|
||||
set(CPACK_PACKAGE_NAME "mapnik")
|
||||
set(CPACK_PACKAGE_CONTACT "ubuntu-mathis@outlook.com")
|
||||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://mapnik.org")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
|
||||
set(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
set(CPACK_GENERATOR "DEB;TGZ")
|
||||
set(CPACK_SOURCE_IGNORE_FILES
|
||||
\\.git/
|
||||
build/
|
||||
|
|
Loading…
Reference in a new issue