2022-01-28 11:10:24 +01:00
|
|
|
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
|
2022-04-16 11:26:34 +02:00
|
|
|
BUILD_SHARED:
|
|
|
|
required: true
|
|
|
|
type: boolean
|
2022-01-28 11:10:24 +01:00
|
|
|
secrets:
|
|
|
|
NUGET_REGISTRY_PAT:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
|
2022-02-02 18:02:08 +01:00
|
|
|
VCPKG_NUGET_REPOSITORY: https://github.com/mapnik/vcpkg-cache.git
|
2022-01-28 11:10:24 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
- name: checkout mapnik
|
2022-04-11 15:04:30 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-01-28 11:10:24 +01:00
|
|
|
with:
|
|
|
|
submodules: "recursive"
|
|
|
|
|
|
|
|
- name: checkout vcpkg
|
2022-04-11 15:04:30 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-01-28 11:10:24 +01:00
|
|
|
with:
|
|
|
|
repository: "microsoft/vcpkg"
|
|
|
|
ref: ${{ inputs.VCPKG_SHA }}
|
|
|
|
path: vcpkg
|
|
|
|
|
|
|
|
- name: "Setup vcpkg"
|
|
|
|
shell: bash
|
|
|
|
run: ./vcpkg/bootstrap-vcpkg.sh
|
|
|
|
|
|
|
|
- name: "Setup NuGet Credentials"
|
2022-02-02 18:02:08 +01:00
|
|
|
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
2022-01-28 11:10:24 +01:00
|
|
|
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"
|
2022-02-02 18:02:08 +01:00
|
|
|
if: ${{ !(github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik') }}
|
2022-01-28 11:10:24 +01:00
|
|
|
shell: "bash"
|
|
|
|
run: >
|
|
|
|
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
|
|
|
setapikey "${{ secrets.NUGET_REGISTRY_PAT }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
|
|
|
|
2022-02-02 18:02:08 +01:00
|
|
|
- name: "Setup NuGet Credentials READONLY"
|
|
|
|
if: ${{ github.event_name == 'pull_request' || github.repository != 'mapnik/mapnik' }}
|
|
|
|
shell: "bash"
|
|
|
|
run: >
|
2022-02-08 14:59:43 +01:00
|
|
|
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
2022-02-02 18:02:08 +01:00
|
|
|
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: >
|
2022-02-08 14:59:43 +01:00
|
|
|
${{ env.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
|
2022-02-02 18:02:08 +01:00
|
|
|
setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "${{ inputs.NUGET_REGISTRY }}"
|
|
|
|
|
2022-01-28 11:10:24 +01:00
|
|
|
- name: Configure CMake
|
2022-04-16 11:26:34 +02:00
|
|
|
run: cmake -DUSE_MEMORY_MAPPED_FILE=${{ inputs.USE_MEMORY_MAPPED_FILE }} -DBUILD_SHARED_LIBS=${{ inputs.BUILD_SHARED }} --preset=${{ env.preset }}
|
2022-01-28 11:10:24 +01:00
|
|
|
|
|
|
|
- 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:
|
2022-03-18 22:56:06 +01:00
|
|
|
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj/data
|
2022-01-28 11:10:24 +01:00
|
|
|
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:
|
2022-03-18 22:56:06 +01:00
|
|
|
PROJ_LIB: ${{ github.workspace }}/build/${{ env.preset }}/vcpkg_installed/x64-linux/share/proj/data
|
2022-01-28 11:10:24 +01:00
|
|
|
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
|
2022-04-11 15:04:30 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-28 11:10:24 +01:00
|
|
|
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
|
2022-04-11 15:04:30 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-28 11:10:24 +01:00
|
|
|
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
|