blob: fe7fa05c93fa90659b2f51e98debed8480ef8804 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: CI - CPP build on Windows
on:
pull_request:
branches:
- branch-*
paths:
- '.github/workflows/**'
- 'pulsar-client-cpp/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
VCPKG_FEATURE_FLAGS: manifests
jobs:
cpp-build-windows:
timeout-minutes: 120
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: 'Windows x64'
os: windows-2022
triplet: x64-windows
vcpkg_dir: 'C:\vcpkg'
suffix: 'windows-win64'
generator: 'Visual Studio 17 2022'
arch: '-A x64'
- name: 'Windows x86'
os: windows-2022
triplet: x86-windows
vcpkg_dir: 'C:\vcpkg'
suffix: 'windows-win32'
generator: 'Visual Studio 17 2022'
arch: '-A Win32'
steps:
- name: checkout
uses: actions/checkout@v2
- name: Detect changed files
id: changes
uses: apache/pulsar-test-infra/paths-filter@master
with:
filters: .github/changes-filter.yaml
- name: Check changed files
id: check_changes
run: echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
- name: Install vcpkg packages
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
shell: bash
run: |
cd pulsar-client-cpp && vcpkg install --triplet ${{ matrix.triplet }}
- name: Configure (default)
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd pulsar-client-cpp && \
cmake \
-B ./build \
-G "${{ matrix.generator }}" ${{ matrix.arch }} \
-DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF \
-DVCPKG_TRIPLET=${{ matrix.triplet }} \
-DCMAKE_BUILD_TYPE=Release \
-S .
fi
- name: Compile
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd pulsar-client-cpp && \
cmake --build ./build --config Release
fi
- name: Configure (dynamic library only)
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd pulsar-client-cpp && \
cmake \
-B ./build-1 \
-G "${{ matrix.generator }}" ${{ matrix.arch }} \
-DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF \
-DVCPKG_TRIPLET=${{ matrix.triplet }} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_STATIC_LIB=OFF \
-S .
fi
- name: Compile
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
cd pulsar-client-cpp && \
cmake --build ./build-1 --config Release
fi