Files
yaml-cpp/.github/workflows/build.yml
Dr. Andre Vehreschild 420c982310 Improve bazel build for Windows. (#1100)
Windows builds need some defines being set to use the static linking.

Also add bazel builds and test to Github-CI.
2022-04-27 09:10:13 -05:00

63 lines
1.7 KiB
YAML

name: Github PR
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
cmake-build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build: [static, shared]
generator: ["Default Generator", "MinGW Makefiles"]
exclude:
- os: macos-latest
build: shared
- os: macos-latest
generator: "MinGW Makefiles"
- os: ubuntu-latest
generator: "MinGW Makefiles"
env:
YAML_BUILD_SHARED_LIBS: ${{ matrix.build == 'shared' && 'ON' || 'OFF' }}
CMAKE_GENERATOR: >-
${{format(matrix.generator != 'Default Generator' && '-G "{0}"' || '', matrix.generator)}}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
- name: Build
shell: bash
run: |
cmake ${{ env.CMAKE_GENERATOR }} -S "${{ github.workspace }}" -B build -DYAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }}
cd build && cmake --build . --parallel ${{ steps.cpu-cores.outputs.count }}
- name: Test
shell: bash
run: cd build && ctest --output-on-failure
bazel-build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build
shell: bash
run: |
cd "${{ github.workspace }}"
bazel build :all
- name: Test
shell: bash
run: |
cd "${{ github.workspace }}"
bazel test test