|
| 1 | +# vcpkg integration smoke test. |
| 2 | +# |
| 3 | +# Installs geo-utils-cpp from the official microsoft/vcpkg registry, then |
| 4 | +# configures and builds the minimal consumer project (tests/consumer/) using |
| 5 | +# the vcpkg CMake toolchain file. Runs on Linux/macOS/Windows in parallel. |
| 6 | +# |
| 7 | +# What this catches: |
| 8 | +# - Breakage in the published vcpkg port |
| 9 | +# - Drift in vcpkg infrastructure or GitHub runner images |
| 10 | +# - Our exported CMake config / target name not surviving an install via vcpkg |
| 11 | +# |
| 12 | +# What this does NOT catch: |
| 13 | +# - Regressions introduced in this repo on a PR — vcpkg ships the *released* |
| 14 | +# version (currently 1.0.1), not HEAD. The PR/push runs verify the |
| 15 | +# published port still works; the weekly schedule catches drift over time. |
| 16 | +# |
| 17 | +# Triggered automatically on push/PR to master/main; runs weekly to catch |
| 18 | +# upstream drift; can also be run manually from the Actions tab. |
| 19 | + |
| 20 | +name: vcpkg |
| 21 | + |
| 22 | +on: |
| 23 | + push: |
| 24 | + branches: [master, main] |
| 25 | + pull_request: |
| 26 | + branches: [master, main] |
| 27 | + workflow_dispatch: |
| 28 | + schedule: |
| 29 | + # Mondays 06:00 UTC. Catches drift in the vcpkg registry / runner images. |
| 30 | + - cron: '0 6 * * 1' |
| 31 | + |
| 32 | +permissions: |
| 33 | + contents: read |
| 34 | + |
| 35 | +concurrency: |
| 36 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 37 | + cancel-in-progress: true |
| 38 | + |
| 39 | +jobs: |
| 40 | + vcpkg-consumer: |
| 41 | + name: vcpkg + consumer (${{ matrix.os }}) |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 46 | + |
| 47 | + runs-on: ${{ matrix.os }} |
| 48 | + |
| 49 | + defaults: |
| 50 | + run: |
| 51 | + # Bash is available on all GH-hosted runners (Git Bash on Windows) and |
| 52 | + # gives us consistent $VCPKG_INSTALLATION_ROOT expansion across platforms. |
| 53 | + shell: bash |
| 54 | + |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + |
| 58 | + # GH-hosted runners ship vcpkg pre-installed at $VCPKG_INSTALLATION_ROOT. |
| 59 | + # The bundled checkout can lag the registry by days/weeks, so sync to |
| 60 | + # origin/master to make sure the geo-utils-cpp port is present and |
| 61 | + # current. fetch+reset (rather than `pull --ff-only`) is robust against |
| 62 | + # the runner image leaving HEAD detached or off master — the runner is |
| 63 | + # disposable, so a hard reset is safe. |
| 64 | + - name: Sync vcpkg registry |
| 65 | + run: | |
| 66 | + git -C "$VCPKG_INSTALLATION_ROOT" fetch --depth=1 origin master |
| 67 | + git -C "$VCPKG_INSTALLATION_ROOT" reset --hard FETCH_HEAD |
| 68 | +
|
| 69 | + - name: Install geo-utils-cpp via vcpkg |
| 70 | + run: "$VCPKG_INSTALLATION_ROOT/vcpkg" install geo-utils-cpp |
| 71 | + |
| 72 | + - name: Configure consumer with vcpkg toolchain |
| 73 | + run: | |
| 74 | + cmake -S tests/consumer -B build-consumer \ |
| 75 | + -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" |
| 76 | +
|
| 77 | + - name: Build consumer |
| 78 | + run: cmake --build build-consumer --config Release |
| 79 | + |
| 80 | + - name: Test consumer |
| 81 | + run: ctest --test-dir build-consumer -C Release --output-on-failure |
0 commit comments