Skip to content

Commit f91e938

Browse files
authored
Merge pull request #2 from azat-ch/update-lib-and-merge-operator
Update lib and apply PR for YAML Merge Key
2 parents 0c86ada + 2ce752f commit f91e938

File tree

354 files changed

+20868
-24176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+20868
-24176
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/gtest-1.11.0

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
11+

.github/workflows/build.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Github PR
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
workflow_dispatch:
8+
permissions: read-all
9+
defaults:
10+
run:
11+
shell: bash
12+
jobs:
13+
cmake-build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
cxx_standard: [11, 17, 20]
19+
build: [static, shared]
20+
googletest: [build, system]
21+
generator: ["Default Generator", "MinGW Makefiles"]
22+
exclude:
23+
- os: macos-latest
24+
build: shared
25+
- os: macos-latest
26+
generator: "MinGW Makefiles"
27+
- os: ubuntu-latest
28+
generator: "MinGW Makefiles"
29+
- os: macos-latest
30+
googletest: system
31+
- os: windows-latest
32+
googletest: system
33+
env:
34+
YAML_BUILD_SHARED_LIBS: ${{ matrix.build == 'shared' && 'ON' || 'OFF' }}
35+
YAML_USE_SYSTEM_GTEST: ${{ matrix.googletest == 'system' && 'ON' || 'OFF' }}
36+
CMAKE_GENERATOR: >-
37+
${{format(matrix.generator != 'Default Generator' && '-G "{0}"' || '', matrix.generator)}}
38+
CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/install-prefix"
39+
CMAKE_BUILD_TYPE: Debug
40+
CMAKE_CXX_FLAGS_DEBUG: ${{ matrix.googletest == 'build' && '-g -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC' || '-g' }}
41+
runs-on: ${{ matrix.os }}
42+
steps:
43+
44+
- uses: awalsh128/cache-apt-pkgs-action@latest
45+
if: matrix.os == 'ubuntu-latest'
46+
with:
47+
packages: googletest libgmock-dev libgtest-dev
48+
version: 1.0
49+
50+
- uses: actions/checkout@v4
51+
52+
- name: Configure
53+
run: |
54+
cmake \
55+
${{ env.CMAKE_GENERATOR }} \
56+
-S "${{ github.workspace }}" \
57+
-B build \
58+
-D CMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} \
59+
-D CMAKE_INSTALL_PREFIX="${{ env.CMAKE_INSTALL_PREFIX }}" \
60+
-D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
61+
-D CMAKE_CXX_FLAGS_DEBUG="${{ env.CMAKE_CXX_FLAGS_DEBUG }}" \
62+
-D YAML_BUILD_SHARED_LIBS=${{ env.YAML_BUILD_SHARED_LIBS }} \
63+
-D YAML_USE_SYSTEM_GTEST=${{ env.YAML_USE_SYSTEM_GTEST }} \
64+
-D YAML_CPP_BUILD_TESTS=ON
65+
66+
- name: Build
67+
run: |
68+
cmake \
69+
--build build \
70+
--config ${{ env.CMAKE_BUILD_TYPE }} \
71+
--verbose \
72+
--parallel
73+
74+
- name: Run Tests
75+
shell: bash
76+
run: |
77+
ctest \
78+
--test-dir build \
79+
--build-config ${{ env.CMAKE_BUILD_TYPE }} \
80+
--output-on-failure \
81+
--verbose
82+
83+
- name: Install
84+
run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }}
85+
86+
- name: Configure CMake package test
87+
run: |
88+
cmake \
89+
${{ env.CMAKE_GENERATOR }} \
90+
-S "${{ github.workspace }}/test/cmake" \
91+
-B consumer-build \
92+
-D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
93+
-D CMAKE_PREFIX_PATH="${{ env.CMAKE_INSTALL_PREFIX }}"
94+
95+
- name: Build CMake package test
96+
run: |
97+
cmake \
98+
--build consumer-build \
99+
--config ${{ env.CMAKE_BUILD_TYPE }} \
100+
--verbose
101+
102+
bazel-build:
103+
strategy:
104+
matrix:
105+
os: [ubuntu-latest, windows-latest, macos-latest]
106+
runs-on: ${{ matrix.os }}
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Build
111+
run: |
112+
cd "${{ github.workspace }}"
113+
bazel build :all
114+
115+
- name: Test
116+
run: |
117+
cd "${{ github.workspace }}"
118+
bazel test test
119+
120+
bzlmod-build:
121+
strategy:
122+
matrix:
123+
os: [ubuntu-latest, windows-latest, macos-latest]
124+
runs-on: ${{ matrix.os }}
125+
steps:
126+
- uses: actions/checkout@v4
127+
128+
- name: Build
129+
shell: bash
130+
run: |
131+
cd "${{ github.workspace }}"
132+
bazel build --enable_bzlmod :all
133+
134+
- name: Test
135+
shell: bash
136+
run: |
137+
cd "${{ github.workspace }}"
138+
bazel test --enable_bzlmod test
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Bazel Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
# A release archive is required for bzlmod
9+
# See: https://blog.bazel.build/2023/02/15/github-archive-checksum.html
10+
bazel-release-archive:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
16+
- run: git archive $GITHUB_REF -o "yaml-cpp-${GITHUB_REF:10}.tar.gz"
17+
- run: gh release upload ${GITHUB_REF:10} "yaml-cpp-${GITHUB_REF:10}.tar.gz"
18+
env:
19+
GH_TOKEN: ${{ github.token }}

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
yaml_cpp_defines = select({
2+
# On Windows, ensure static linking is used.
3+
"@platforms//os:windows": ["YAML_CPP_STATIC_DEFINE", "YAML_CPP_NO_CONTRIB"],
4+
"//conditions:default": [],
5+
})
6+
17
cc_library(
28
name = "yaml-cpp_internal",
39
visibility = ["//:__subpackages__"],
@@ -11,4 +17,5 @@ cc_library(
1117
includes = ["include"],
1218
hdrs = glob(["include/**/*.h"]),
1319
srcs = glob(["src/**/*.cpp", "src/**/*.h"]),
20+
defines = yaml_cpp_defines,
1421
)

0 commit comments

Comments
 (0)