forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into unset-by-index
- Loading branch information
Showing
462 changed files
with
17,048 additions
and
9,472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Ruby Install Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- '[0-9]+.x' | ||
pull_request: | ||
branches: | ||
- main | ||
- '[0-9]+.x' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test_ruby_gems: | ||
name: Test ruby gems | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { ruby: 2.6, bazel: 6.0.0} | ||
- { ruby: 2.7, bazel: 6.0.0} | ||
- { ruby: 3.0, bazel: 6.0.0} | ||
- { ruby: 3.1, bazel: 6.0.0} | ||
- { ruby: 3.2, bazel: 6.0.0} | ||
- { ruby: jruby-9.2, bazel: 6.0.0} | ||
- { ruby: jruby-9.3, bazel: 6.0.0} | ||
- { ruby: 2.6, bazel: 5.1.1} | ||
- { ruby: jruby-9.2, bazel: 5.1.1} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install bazel | ||
run: | | ||
sudo apt-get install -qy wget | ||
mkdir $HOME/bin | ||
wget -O $HOME/bin/bazel https://github.com/bazelbuild/bazel/releases/download/${{ matrix.bazel }}/bazel-${{ matrix.bazel }}-linux-x86_64 | ||
chmod a+x $HOME/bin/bazel | ||
- name: Install git | ||
run: | | ||
sudo apt-get install -qy --no-install-recommends git | ||
- name: Install ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Build cruby gem | ||
run: $HOME/bin/bazel build ruby:release | ||
if: ${{ !contains(matrix.ruby, 'jruby') }} | ||
- name: Install cruby gem | ||
run: gem install bazel-bin/ruby/google-protobuf-* | ||
if: ${{ !contains(matrix.ruby, 'jruby') }} | ||
- name: Build jruby gem | ||
run: $HOME/bin/bazel build ruby:jruby_release | ||
if: ${{ contains(matrix.ruby, 'jruby') }} | ||
- name: Install jruby gem | ||
run: gem install bazel-bin/ruby/google-protobuf-* | ||
if: ${{ contains(matrix.ruby, 'jruby') }} | ||
- name: Test installation | ||
run: | | ||
bazel run //:protoc -- --proto_path=$GITHUB_WORKSPACE/src --proto_path=$GITHUB_WORKSPACE/ruby/tests --proto_path=$GITHUB_WORKSPACE/ruby --ruby_out=$GITHUB_WORKSPACE/ruby tests/test_import_proto2.proto | ||
bazel run //:protoc -- --proto_path=$GITHUB_WORKSPACE/src --proto_path=$GITHUB_WORKSPACE/ruby/tests --proto_path=$GITHUB_WORKSPACE/ruby --ruby_out=$GITHUB_WORKSPACE/ruby tests/basic_test.proto | ||
ruby ruby/tests/basic.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- upbc/bootstrap_compiler.bzl | ||
+++ upbc/bootstrap_compiler.bzl | ||
@@ -20,7 +20,7 @@ _upbc_base = "//upbc:protoc-gen-upb" | ||
|
||
# begin:github_only | ||
_is_google3 = False | ||
-_extra_proto_path = "-Iexternal/com_google_protobuf/src " | ||
+_extra_proto_path = "-Isrc " | ||
# end:github_only | ||
|
||
def _upbc(stage): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
option(protobuf_USE_EXTERNAL_GTEST "Use external Google Test (i.e. not the one in third_party/googletest)" OFF) | ||
|
||
if (protobuf_USE_EXTERNAL_GTEST) | ||
find_package(GTest REQUIRED) | ||
else() | ||
if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/googletest/CMakeLists.txt") | ||
message(FATAL_ERROR | ||
"Cannot find third_party/googletest directory that's needed to " | ||
"build tests. If you use git, make sure you have cloned submodules:\n" | ||
" git submodule update --init --recursive\n" | ||
"If instead you want to skip tests, run cmake with:\n" | ||
" cmake -Dprotobuf_BUILD_TESTS=OFF\n") | ||
endif() | ||
|
||
set(googlemock_source_dir "${protobuf_SOURCE_DIR}/third_party/googletest/googlemock") | ||
set(googletest_source_dir "${protobuf_SOURCE_DIR}/third_party/googletest/googletest") | ||
include_directories( | ||
${googlemock_source_dir} | ||
${googletest_source_dir} | ||
${googletest_source_dir}/include | ||
${googlemock_source_dir}/include | ||
) | ||
|
||
add_library(gmock ${protobuf_SHARED_OR_STATIC} | ||
"${googlemock_source_dir}/src/gmock-all.cc" | ||
"${googletest_source_dir}/src/gtest-all.cc" | ||
) | ||
if (protobuf_BUILD_SHARED_LIBS) | ||
set_target_properties(gmock | ||
PROPERTIES | ||
COMPILE_DEFINITIONS | ||
"GTEST_CREATE_SHARED_LIBRARY=1" | ||
) | ||
install(TARGETS gmock EXPORT protobuf-targets | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
endif() | ||
|
||
target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT}) | ||
add_library(gmock_main STATIC "${googlemock_source_dir}/src/gmock_main.cc") | ||
target_link_libraries(gmock_main gmock) | ||
|
||
add_library(GTest::gmock ALIAS gmock) | ||
add_library(GTest::gmock_main ALIAS gmock_main) | ||
add_library(GTest::gtest ALIAS gmock) | ||
add_library(GTest::gtest_main ALIAS gmock_main) | ||
endif() |
Oops, something went wrong.