Skip to content

versions: register crskit 0.5.0 in the vcpkg registry #41

versions: register crskit 0.5.0 in the vcpkg registry

versions: register crskit 0.5.0 in the vcpkg registry #41

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# The library builds self-contained (SQLite is vendored in Prueba/, GoogleTest is fetched by CMake),
# so a build only needs the compiler + CMake + Ninja. Running the tests additionally needs the EPSG
# SQLite database, which is not versioned: set the repository variable EPSG_SQLITE_URL to a URL that
# serves epsg-fiel.sqlite (e.g. a GitHub Release asset) and the full suite runs; otherwise the job
# still builds everything and reports that the tests were skipped.
jobs:
linux:
name: Linux (GCC 14)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y g++-14 gcc-14 cmake ninja-build
- name: Fetch EPSG database
id: epsg
env:
EPSG_SQLITE_URL: ${{ vars.EPSG_SQLITE_URL }}
run: |
if [ -n "$EPSG_SQLITE_URL" ]; then
curl -fsSL "$EPSG_SQLITE_URL" -o "$PWD/epsg.sqlite"
echo "db=$PWD/epsg.sqlite" >> "$GITHUB_OUTPUT"
else
echo "No EPSG_SQLITE_URL set; the suite will be built but not run."
fi
- name: Configure
run: >
cmake -S . -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_C_COMPILER=gcc-14
-DDIGI21_EPSG_SQLITE="${{ steps.epsg.outputs.db }}"
- name: Build
run: cmake --build build
- name: Test
if: ${{ steps.epsg.outputs.db != '' }}
env:
# A few tests need NTv2/geoid grid files (ICSM Australia, NRCan Canada, IGN Spain) that are
# licence-restricted and cannot be redistributed, so they are excluded here. They run locally
# where the grids are installed; the TestGridFile suite skips itself when a grid is absent.
GTEST_FILTER: "-Test5207Part1.*:Test5207Part2.*:GridFile.CompoundAlicanteHeightToWgs84UsesRednapGeoid"
run: ctest --test-dir build --output-on-failure
windows:
name: Windows (MSVC)
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Fetch EPSG database
id: epsg
shell: bash
env:
EPSG_SQLITE_URL: ${{ vars.EPSG_SQLITE_URL }}
run: |
if [ -n "$EPSG_SQLITE_URL" ]; then
# pwd -W gives a native Windows path (D:/a/...), which SQLite/CMake can open (bash's
# $PWD would be /d/a/..., which sqlite3_open cannot resolve).
dir=$(pwd -W)
curl -fsSL "$EPSG_SQLITE_URL" -o "$dir/epsg.sqlite"
echo "db=$dir/epsg.sqlite" >> "$GITHUB_OUTPUT"
else
echo "No EPSG_SQLITE_URL set; the suite will be built but not run."
fi
- name: Configure
run: >
cmake -S . -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DDIGI21_EPSG_SQLITE="${{ steps.epsg.outputs.db }}"
- name: Build
run: cmake --build build
- name: Test
if: ${{ steps.epsg.outputs.db != '' }}
env:
# A few tests need NTv2/geoid grid files (ICSM Australia, NRCan Canada, IGN Spain) that are
# licence-restricted and cannot be redistributed, so they are excluded here. They run locally
# where the grids are installed; the TestGridFile suite skips itself when a grid is absent.
GTEST_FILTER: "-Test5207Part1.*:Test5207Part2.*:GridFile.CompoundAlicanteHeightToWgs84UsesRednapGeoid"
run: ctest --test-dir build --output-on-failure