Skip to content

Commit

Permalink
Merge branch 'master' into pp/prepare_kotlin_release
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovap authored Dec 7, 2023
2 parents 60393e2 + 5ba80c2 commit 0e1f41a
Show file tree
Hide file tree
Showing 330 changed files with 3,985 additions and 1,979 deletions.
102 changes: 48 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- "*" # new tag version, like `0.8.4` or else
branches:
- master
- flatbuffers-64
pull_request:
branches:
- master
Expand All @@ -22,10 +21,10 @@ jobs:
digests-gcc: ${{ steps.hash-gcc.outputs.hashes }}
digests-clang: ${{ steps.hash-clang.outputs.hashes }}
name: Build Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
matrix:
cxx: [g++-10, clang++-12]
cxx: [g++-13, clang++-15]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand All @@ -39,10 +38,6 @@ jobs:
run: |
chmod +x flatc
./flatc --version
# - name: flatc tests
# run: |
# yarn global add esbuild
# python3 tests/flatc/main.py
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand All @@ -58,35 +53,37 @@ jobs:
with:
files: Linux.flatc.binary.${{ matrix.cxx }}.zip
- name: Generate SLSA subjects - clang
if: matrix.cxx == 'clang++-12' && startsWith(github.ref, 'refs/tags/')
if: matrix.cxx == 'clang++-15' && startsWith(github.ref, 'refs/tags/')
id: hash-clang
run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT
- name: Generate SLSA subjects - gcc
if: matrix.cxx == 'g++-10' && startsWith(github.ref, 'refs/tags/')
if: matrix.cxx == 'g++-13' && startsWith(github.ref, 'refs/tags/')
id: hash-gcc
run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT
build-linux-no-file-tests:

build-linux-no-file-tests:
name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: cmake
run: CXX=clang++-12 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" .
run: CXX=clang++-15 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" .
- name: build
run: make -j
- name: test
run: ./flattests

build-linux-out-of-source:
build-linux-out-of-source:
name: Build Linux with out-of-source build location
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: make build directory
run: mkdir build
- name: cmake
working-directory: build
run: >
CXX=clang++-12 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON
CXX=clang++-15 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON
-DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17
- name: build
working-directory: build
Expand All @@ -100,22 +97,23 @@ jobs:

build-linux-cpp-std:
name: Build Linux C++
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
fail-fast: false
matrix:
std: [11, 14, 17, 20, 23]
cxx: [g++-10, clang++-12]
cxx: [g++-13, clang++-15]
exclude:
# GCC 10.3.0 doesn't support std 23
- cxx: g++-10
std: 23
# Clang++15 10.3.0 stdlibc++ doesn't fully support std 23
- cxx: clang++-15
std: 23

steps:
- uses: actions/checkout@v3
- name: cmake
run: >
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON
CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
-DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
- name: build
Expand All @@ -126,7 +124,7 @@ jobs:
if: matrix.std >= 17
run: ./flattests_cpp17

build-windows-cpp-std:
build-cpp-std:
name: Build Windows C++
runs-on: windows-2019
strategy:
Expand All @@ -139,8 +137,8 @@ jobs:
uses: microsoft/[email protected]
- name: cmake
run: >
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release
-DFLATBUFFERS_STRICT_MODE=ON
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release
-DFLATBUFFERS_STRICT_MODE=ON
-DFLATBUFFERS_CPP_STD=${{ matrix.std }}
-DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}}
- name: build
Expand All @@ -156,7 +154,7 @@ jobs:
contents: write
outputs:
digests: ${{ steps.hash.outputs.hashes }}
name: Build Windows 2019
name: Build Windows 2019
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
Expand All @@ -168,8 +166,6 @@ jobs:
run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64
- name: test
run: Release\flattests.exe
# - name: flatc tests
# run: python3 tests/flatc/main.py --flatc Release\flatc.exe
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -220,20 +216,20 @@ jobs:

build-dotnet-windows:
name: Build .NET Windows
runs-on: windows-2019
runs-on: windows-2022-64core
strategy:
matrix:
configuration: [
'',
'-p:UnsafeByteBuffer=true',
'-p:UnsafeByteBuffer=true',
# Fails two tests currently.
#'-p:EnableSpanT=true,UnsafeByteBuffer=true'
]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
with:
dotnet-version: '3.1.x'
- name: Build
run: |
Expand Down Expand Up @@ -270,8 +266,6 @@ jobs:
run: |
chmod +x Release/flatc
Release/flatc --version
# - name: flatc tests
# run: python3 tests/flatc/main.py --flatc Release/flatc
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
Expand Down Expand Up @@ -336,7 +330,7 @@ jobs:

build-android:
name: Build Android (on Linux)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: set up Java
Expand All @@ -355,10 +349,10 @@ jobs:

build-generator:
name: Check Generated Code
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
matrix:
cxx: [g++-10, clang++-12]
cxx: [g++-13, clang++-15]
steps:
- uses: actions/checkout@v3
- name: cmake
Expand Down Expand Up @@ -386,10 +380,10 @@ jobs:

build-benchmarks:
name: Build Benchmarks (on Linux)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
strategy:
matrix:
cxx: [g++-10]
cxx: [g++-13]
steps:
- uses: actions/checkout@v3
- name: cmake
Expand All @@ -404,7 +398,7 @@ jobs:

build-java:
name: Build Java
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand Down Expand Up @@ -433,7 +427,7 @@ jobs:

build-kotlin-linux:
name: Build Kotlin Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -456,16 +450,16 @@ jobs:

build-rust-linux:
name: Build Rust Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: test
working-directory: tests
run: bash RustTest.sh

build-rust-windows:
name: Build Rust Windows
runs-on: windows-2019
runs-on: windows-2022-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand All @@ -474,7 +468,7 @@ jobs:

build-python:
name: Build Python
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -486,7 +480,7 @@ jobs:

build-go:
name: Build Go
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -498,7 +492,7 @@ jobs:

build-php:
name: Build PHP
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -512,7 +506,7 @@ jobs:
build-swift:
name: Build Swift
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: test
Expand All @@ -523,7 +517,7 @@ jobs:
build-swift-wasm:
name: Build Swift Wasm
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
container:
image: ghcr.io/swiftwasm/carton:0.15.3
steps:
Expand All @@ -536,7 +530,7 @@ jobs:

build-ts:
name: Build TS
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -554,7 +548,7 @@ jobs:
build-dart:
name: Build Dart
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
Expand All @@ -569,7 +563,7 @@ jobs:

build-nim:
name: Build Nim
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- uses: actions/checkout@v3
- name: flatc
Expand All @@ -578,7 +572,7 @@ jobs:
- uses: jiro4989/setup-nim-action@v1
- name: install library
working-directory: nim
run: nimble -y develop
run: nimble -y develop && nimble install
- name: test
working-directory: tests/nim
run: python3 testnim.py
Expand All @@ -588,7 +582,7 @@ jobs:
needs: [build-linux, build-windows, build-mac-intel, build-mac-universal]
outputs:
digests: ${{ steps.hash.outputs.digests }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04-64core
steps:
- name: Merge results
id: hash
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
days-before-issue-close: 14 # 2 weeks
exempt-issue-labels: not-stale

stale-pr-message: 'This pull request is stale because it has been open 3 weeks with no activity. Please comment or label `not-stale`, or this will be closed in 7 days.'
close-pr-message: 'This pull request was automatically closed due to no activity for 3 weeks plus the 7 day notice period.'
days-before-pr-stale: 21 # 3 weeks
days-before-pr-close: 7 # 1 week
stale-pr-message: 'This pull request is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.'
close-pr-message: 'This pull request was automatically closed due to no activity for 6 months plus the 14 day notice period.'
days-before-pr-stale: 182 # 6 months
days-before-pr-close: 14 # 2 week
exempt-pr-labels: not-stale
exempt-draft-pr: false

2 changes: 1 addition & 1 deletion CMake/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
message(WARNING "\"${GIT_DESCRIBE_DIRTY}\" does not match pattern v<major>.<minor>.<patch>-<commit>")
endif()
else()
message(WARNING "git describe failed with exit code: ${GIT_DESCRIBE_RESULT}")
message(WARNING "git describe failed with exit code: ${GIT_DESCRIBE_RESULT}\nMake sure you cloned with tags or run 'git fetch --tags'.")
endif()
else()
message(WARNING "git is not found")
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,11 @@ if(FLATBUFFERS_BUILD_TESTS)

# Add a library so there is a single target that the generated samples can
# link too.
add_library(flatsample INTERFACE)
if(MSVC OR ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0")
add_library(flatsample INTERFACE)
else()
add_library(flatsample STATIC)
endif()

# Since flatsample has no sources, we have to explicitly set the linker lang.
set_target_properties(flatsample PROPERTIES LINKER_LANGUAGE CXX)
Expand Down Expand Up @@ -594,7 +598,7 @@ if(FLATBUFFERS_BUILD_GRPCTEST)
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
add_executable(grpctest ${FlatBuffers_GRPCTest_SRCS})
target_link_libraries(grpctext
target_link_libraries(grpctest
PRIVATE
$<BUILD_INTERFACE:ProjectConfig>
gRPC::grpc++_unsecure
Expand Down
Loading

0 comments on commit 0e1f41a

Please sign in to comment.