mapnik/.github/workflows/build_and_test.yml

116 lines
3.2 KiB
YAML
Raw Normal View History

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
2024-06-14 10:41:49 +02:00
runs-on: ubuntu-22.04
2022-11-21 22:56:50 +01:00
steps:
2024-03-12 14:24:34 +01:00
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
2022-11-21 22:56:50 +01:00
with:
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:
name: >-
Build & Test
(${{ matrix.os }})
(C++ ${{ matrix.cxx-standard }})
${{ startsWith(matrix.os, 'macos-') && (matrix.os == 'macos-14' && '(ARM64)' || '(AMD64)') || '' }}
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-14
2024-06-14 10:41:49 +02:00
- ubuntu-22.04
- windows-2022
cxx-standard:
- 17
2022-11-21 22:56:50 +01:00
include:
- os: macos-14
2022-11-21 22:56:50 +01:00
mono: mono
2024-06-14 10:41:49 +02:00
- os: ubuntu-22.04
2022-11-21 22:56:50 +01:00
mono: mono
- os: windows-2022
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'
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:
vcpkg-sha: ad25766aefb5313b6bc4e2a4b78a2946f84fbf66
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 }}
2024-05-05 04:59:44 +02:00
- name: Set PRESET environment variable to lower case runner OS
shell: bash
2022-11-21 22:56:50 +01:00
run: |
2024-05-05 04:59:44 +02:00
LC_RUNNER_OS=$(echo "${RUNNER_OS}" | perl -ne "print lc")
if [ "${RUNNER_OS}" == "macOS" ]; then
MACOS_ARCH=${{ matrix.os == 'macos-14' && 'arm64' || 'x64' }}
2024-05-05 04:59:44 +02:00
echo "PRESET=${LC_RUNNER_OS}-ci-${MACOS_ARCH}" >> ${GITHUB_ENV}
else
echo "PRESET=${LC_RUNNER_OS}-ci" >> ${GITHUB_ENV}
fi
2022-11-21 22:56:50 +01:00
- name: Ensure libtool is installed on macOS
shell: bash
run: brew install libtool
if: runner.os == 'macOS'
2022-11-21 22:56:50 +01:00
- name: Configure CMake
shell: bash
run: |
cmake \
2024-04-19 15:13:10 +02:00
-DBUILD_SHARED_LIBS:BOOL='ON' \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
2024-04-19 15:13:10 +02:00
-DUSE_MEMORY_MAPPED_FILE:BOOL='ON' \
-LA \
--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 }}