2022-11-21 22:56:50 +01:00
|
|
|
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:
|
2024-03-12 14:24:34 +01:00
|
|
|
- uses: actions/checkout@v4
|
2024-03-12 15:29:59 +01:00
|
|
|
- uses: actions/setup-python@v5
|
2022-11-21 22:56:50 +01:00
|
|
|
with:
|
2024-03-12 11:58:56 +01:00
|
|
|
python-version: '3.10'
|
2024-03-12 14:28:14 +01:00
|
|
|
- uses: pre-commit/action@v3.0.1
|
2022-11-21 22:56:50 +01:00
|
|
|
|
|
|
|
buildAndTest:
|
2023-03-17 18:51:15 +01:00
|
|
|
name: >-
|
|
|
|
Build & Test
|
|
|
|
(${{ matrix.os }})
|
|
|
|
(C++ ${{ matrix.cxx-standard }})
|
2022-11-26 16:10:16 +01:00
|
|
|
needs: checkSource
|
2022-11-21 22:56:50 +01:00
|
|
|
strategy:
|
2022-11-26 16:40:16 +01:00
|
|
|
fail-fast: false
|
2022-11-21 22:56:50 +01:00
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
2024-04-16 10:24:55 +02:00
|
|
|
cxx-standard: [17]
|
2022-11-21 22:56:50 +01:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
mono: mono
|
|
|
|
- os: macos-latest
|
|
|
|
mono: mono
|
2023-03-17 18:51:15 +01:00
|
|
|
- os: windows-latest
|
2022-11-21 22:56:50 +01:00
|
|
|
|
|
|
|
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'
|
2024-03-12 11:58:56 +01:00
|
|
|
|
2022-11-21 22:56:50 +01:00
|
|
|
- name: checkout mapnik
|
2024-03-12 14:24:34 +01:00
|
|
|
uses: actions/checkout@v4
|
2022-11-21 22:56:50 +01:00
|
|
|
with:
|
|
|
|
submodules: "recursive"
|
|
|
|
|
|
|
|
- name: setup vcpkg
|
|
|
|
uses: ./.github/actions/setup_vcpkg
|
|
|
|
with:
|
2024-04-16 10:24:55 +02:00
|
|
|
vcpkg-sha: b4a3d89125e45bc8f80fb94bef9761d4f4e14fb9
|
2022-11-21 22:56:50 +01:00
|
|
|
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
|
2024-04-20 01:27:01 +02:00
|
|
|
uses: ASzc/change-string-case-action@v6
|
2022-11-21 22:56:50 +01:00
|
|
|
with:
|
|
|
|
string: ${{ runner.os }}
|
2024-03-12 11:58:56 +01:00
|
|
|
|
2022-11-21 22:56:50 +01:00
|
|
|
- name: set lower case runner os
|
2023-03-17 18:51:15 +01:00
|
|
|
shell: bash
|
2022-11-21 22:56:50 +01:00
|
|
|
run: |
|
|
|
|
echo "PRESET=${{ steps.lc_platform.outputs.lowercase }}-ci" >>${GITHUB_ENV}
|
|
|
|
|
|
|
|
- name: Configure CMake
|
2023-03-17 18:51:15 +01:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cmake \
|
2024-04-19 15:13:10 +02:00
|
|
|
-DBUILD_SHARED_LIBS:BOOL='ON' \
|
2024-04-16 10:24:55 +02:00
|
|
|
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
2024-04-19 15:13:10 +02:00
|
|
|
-DUSE_MEMORY_MAPPED_FILE:BOOL='ON' \
|
2023-03-19 22:05:58 +01:00
|
|
|
-LA \
|
2023-03-17 18:51:15 +01:00
|
|
|
--preset ${{ env.PRESET }}
|
2022-11-21 22:56:50 +01:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: cmake --build --preset ${{ env.PRESET }}
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
uses: ./.github/actions/run_tests
|
|
|
|
with:
|
|
|
|
cmake-preset: ${{ env.PRESET }}
|