Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more protobuf versions in GitHub workflow #766

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
8a3f62a
Change protobuf version to 2.6.1
ClemensLinnhoff Jan 22, 2024
27a7ee2
Remove -all
ClemensLinnhoff Jan 22, 2024
15ca287
Introduce autotools parameter
ClemensLinnhoff Jan 22, 2024
585dc43
Fix autotools if condition
ClemensLinnhoff Jan 22, 2024
839807b
Set autotools variable also for proto3
ClemensLinnhoff Jan 22, 2024
e69a4ac
Get version from protoc in setup.py
ClemensLinnhoff Jan 22, 2024
4819ebc
Black formatting
ClemensLinnhoff Jan 22, 2024
a0780dc
Test protobuf 3.15.0
ClemensLinnhoff Jan 22, 2024
b301ddb
Test protobuf 25.2
ClemensLinnhoff Jan 22, 2024
27e155e
Test protobuf 25.2
ClemensLinnhoff Jan 22, 2024
c83b34f
Test protobuf 3.4.0
ClemensLinnhoff Jan 22, 2024
e717854
Test protobuf 3.0.0
ClemensLinnhoff Jan 22, 2024
34869cc
Test protobuf 3.0.0
ClemensLinnhoff Jan 22, 2024
4f99edd
Test protobuf 3.4.0
ClemensLinnhoff Jan 22, 2024
97c61a5
Test protobuf 25.2
ClemensLinnhoff Jan 22, 2024
aa8ad10
Add linux to version number
ClemensLinnhoff Jan 22, 2024
3f536d8
Try cpp version
ClemensLinnhoff Jan 22, 2024
76afb88
Try protobuf 3.16.0
ClemensLinnhoff Jan 22, 2024
a9f8cef
Try protobuf 25.2
ClemensLinnhoff Jan 22, 2024
538f8f0
Try protobuf 24.3
ClemensLinnhoff Jan 22, 2024
5ddaafb
Change setting true false in if condition
ClemensLinnhoff Jan 22, 2024
e03c880
Change setting true false in if condition
ClemensLinnhoff Jan 22, 2024
a2d587f
Try if condition
ClemensLinnhoff Jan 22, 2024
7f07daf
Fix proto3
ClemensLinnhoff Jan 22, 2024
33b7304
Fix protobuf versioning in setup.py
ClemensLinnhoff Jan 22, 2024
d4bdad0
Test protobuf 25.2
ClemensLinnhoff Jan 22, 2024
f52f453
Test protobuf 3.18.0
ClemensLinnhoff Jan 22, 2024
d562fd4
Test protobuf 3.5.0
ClemensLinnhoff Jan 22, 2024
bf9f97d
Test protobuf 3.0.0
ClemensLinnhoff Jan 22, 2024
1edbf2b
Test protobuf 3.5.1
ClemensLinnhoff Jan 22, 2024
21ea6bf
Test protobuf 3.0.2
ClemensLinnhoff Jan 22, 2024
43b46c5
Test protobuf 2.6.1
ClemensLinnhoff Jan 22, 2024
c23d4c6
Try CXXFLAGS=-std=c++11 for protobuf 3.5.1
ClemensLinnhoff Jan 22, 2024
59cc72c
Try CXXFLAGS=-std=c++11 for protobuf 2.6.1
ClemensLinnhoff Jan 22, 2024
296df42
Try CXXFLAGS=-std=c++11 for protobuf 3.0.2
ClemensLinnhoff Jan 22, 2024
2a986b9
Try CXXFLAGS=-std=c++11 for protobuf 3.5.1
ClemensLinnhoff Jan 22, 2024
2a5db98
Try CXXFLAGS=-std=c++11 for protobuf 2.6.1
ClemensLinnhoff Jan 22, 2024
cd44dc0
Set c++ standard to 17 for autotools, as it is set for cmake
ClemensLinnhoff Jan 22, 2024
bb4a3b0
Try protobuf 3.0.0
ClemensLinnhoff Jan 22, 2024
143d0a1
Try protobuf 3.0.2
ClemensLinnhoff Jan 22, 2024
d6080b7
Protobuf 3.0.2, CXXFLAGS=-std=c++11
ClemensLinnhoff Jan 22, 2024
f7245b6
Protobuf 3.0.0, CXXFLAGS=-std=c++11
ClemensLinnhoff Jan 22, 2024
4670a62
Protobuf 3.18.0, CXXFLAGS=-std=c++11
ClemensLinnhoff Jan 22, 2024
a2c74a0
Protobuf 25.2, CXXFLAGS=-std=c++11
ClemensLinnhoff Jan 22, 2024
9c52c93
Protobuf 2.6.1, CXXFLAGS=-std=c++11
ClemensLinnhoff Jan 22, 2024
0d5a9c8
Try setting protoc path variable
ClemensLinnhoff Feb 8, 2024
2cc5309
Formatting
ClemensLinnhoff Feb 8, 2024
3f6e419
Don't execute proto3 job when 2.6.1 is set
ClemensLinnhoff Feb 8, 2024
dba583f
Set protoc path
ClemensLinnhoff Feb 8, 2024
6bb1905
Fix proto3 if
ClemensLinnhoff Feb 8, 2024
ae099f3
Fix proto3 if
ClemensLinnhoff Feb 8, 2024
e92c691
another try for if
ClemensLinnhoff Feb 8, 2024
ecbca3e
Change if
ClemensLinnhoff Feb 8, 2024
64dc9f9
Formatting
ClemensLinnhoff Feb 8, 2024
54e021c
Set protoc path at different location
ClemensLinnhoff Feb 8, 2024
e530410
Set protoc path in ci pipeline
ClemensLinnhoff Feb 8, 2024
ecba368
Check python site
ClemensLinnhoff Feb 8, 2024
ee86928
New trial
ClemensLinnhoff Feb 8, 2024
8ae2b9c
Check site-packages
ClemensLinnhoff Feb 8, 2024
ffb8e4a
Remove trial code
ClemensLinnhoff Feb 8, 2024
c3647be
Check site-packages
ClemensLinnhoff Feb 8, 2024
5448473
Formatting
ClemensLinnhoff Feb 8, 2024
24be253
Check site-packages folder
ClemensLinnhoff Feb 8, 2024
90b099c
Protobuf python test
ClemensLinnhoff Feb 8, 2024
5aa498d
Fix test
ClemensLinnhoff Feb 8, 2024
ff14295
Fix test
ClemensLinnhoff Feb 8, 2024
1216a91
Fix test
ClemensLinnhoff Feb 8, 2024
ea5d18b
Try setting environment variable
ClemensLinnhoff Feb 8, 2024
35d7d6a
Try removing path to description.proto
ClemensLinnhoff Feb 8, 2024
5d15e30
Revert
ClemensLinnhoff Feb 8, 2024
0576912
Try specifying include path
ClemensLinnhoff Feb 8, 2024
e9206e3
Set proto_path
ClemensLinnhoff Feb 8, 2024
896b108
Add second proto_path
ClemensLinnhoff Feb 8, 2024
49a805d
Check protobuf include files
ClemensLinnhoff Feb 8, 2024
b1f7944
Set protobuf src directory
ClemensLinnhoff Feb 8, 2024
978d068
Add user/include
ClemensLinnhoff Feb 8, 2024
518e0be
Set proto_path in setup.py
ClemensLinnhoff Feb 8, 2024
1a361b8
reformat check_call
ClemensLinnhoff Feb 8, 2024
0f49330
Remove test steps in pipeline
ClemensLinnhoff Feb 8, 2024
13f5180
Merge branch 'master' into 765-check-different-protobuf-versions
ClemensLinnhoff Apr 26, 2024
8830b25
Fix setup.py file ending
ClemensLinnhoff Apr 26, 2024
1305513
Fix proto3 piepline
ClemensLinnhoff Apr 26, 2024
e563daf
Change protobuf version
ClemensLinnhoff Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: ProtoBuf CI Builds

env:
PROTOBUF_VERSION: 3.20.1
PROTOBUF_VARIANT: '-all' # Use '-all' prior to 22.0, '' after
PROTOBUF_VARIANT: '-cpp' # Use '-cpp' between 3.0.0 and 22.0, otherwise use ''
USE_AUTOTOOLS: true # set true for PROTOBUF_VERSION <= 22.0
ABSEIL_VERSION: 20230802.1

on:
Expand Down Expand Up @@ -67,16 +68,16 @@ jobs:
run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${{env.PROTOBUF_VERSION}}/protobuf${{env.PROTOBUF_VARIANT}}-${{env.PROTOBUF_VERSION}}.tar.gz && tar xzvf protobuf${{env.PROTOBUF_VARIANT}}-${{env.PROTOBUF_VERSION}}.tar.gz

- name: Download Abseil ${{ env.ABSEIL_VERSION }}
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
if: steps.cache-depends.outputs.cache-hit != 'true' && env.USE_AUTOTOOLS != 'true'
run: curl -OL https://github.com/abseil/abseil-cpp/archive/refs/tags/${{env.ABSEIL_VERSION}}.tar.gz && tar xzvf ${{env.ABSEIL_VERSION}}.tar.gz && rm -rf protobuf-${{env.PROTOBUF_VERSION}}/third_party/abseil-cpp && mv abseil-cpp-${{env.ABSEIL_VERSION}} protobuf-${{env.PROTOBUF_VERSION}}/third_party/abseil-cpp

- name: Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via autotools
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == '-all'
if: steps.cache-depends.outputs.cache-hit != 'true' && env.USE_AUTOTOOLS == 'true'
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
run: ./configure DIST_LANG=cpp --prefix=/usr && make
run: ./configure CXXFLAGS=-std=c++11 DIST_LANG=cpp --prefix=/usr && make

- name: Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via cmake
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
if: steps.cache-depends.outputs.cache-hit != 'true' && env.USE_AUTOTOOLS != 'true'
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
run: cmake -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4

Expand Down Expand Up @@ -146,7 +147,6 @@ jobs:

build-proto3-linux64:
name: Build Proto3 Linux 64

runs-on: ubuntu-22.04

steps:
Expand All @@ -167,38 +167,42 @@ jobs:
python -m pip install -r requirements_tests.txt

- name: Cache Dependencies
if: env.PROTOBUF_VERSION != '2.6.1'
id: cache-depends
uses: actions/cache@v4
with:
path: protobuf-${{ env.PROTOBUF_VERSION }}
key: ${{ runner.os }}-v2-depends

- name: Download ProtoBuf ${{ env.PROTOBUF_VERSION }}
if: steps.cache-depends.outputs.cache-hit != 'true'
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VERSION != '2.6.1' #Has to be in every step, see https://github.com/actions/runner/issues/1189
run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${{env.PROTOBUF_VERSION}}/protobuf${{env.PROTOBUF_VARIANT}}-${{env.PROTOBUF_VERSION}}.tar.gz && tar xzvf protobuf${{env.PROTOBUF_VARIANT}}-${{env.PROTOBUF_VERSION}}.tar.gz

- name: Download Abseil ${{ env.ABSEIL_VERSION }}
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
if: steps.cache-depends.outputs.cache-hit != 'true' && env.USE_AUTOTOOLS != 'true' && env.PROTOBUF_VERSION != '2.6.1'
run: curl -OL https://github.com/abseil/abseil-cpp/archive/refs/tags/${{env.ABSEIL_VERSION}}.tar.gz && tar xzvf ${{env.ABSEIL_VERSION}}.tar.gz && rm -rf protobuf-${{env.PROTOBUF_VERSION}}/third_party/abseil-cpp && mv abseil-cpp-${{env.ABSEIL_VERSION}} protobuf-${{env.PROTOBUF_VERSION}}/third_party/abseil-cpp

- name: Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via autotools
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == '-all'
if: steps.cache-depends.outputs.cache-hit != 'true' && env.USE_AUTOTOOLS == 'true' && env.PROTOBUF_VERSION != '2.6.1'
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
run: ./configure DIST_LANG=cpp --prefix=/usr && make
run: ./configure CXXFLAGS=-std=c++11 DIST_LANG=cpp --prefix=/usr && make

- name: Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via cmake
if: steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
if: steps.cache-depends.outputs.cache-hit != 'true' && env.USE_AUTOTOOLS != 'true' && env.PROTOBUF_VERSION != '2.6.1'
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
run: cmake -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4

- name: Install ProtoBuf ${{ env.PROTOBUF_VERSION }}
if: env.PROTOBUF_VERSION != '2.6.1'
working-directory: protobuf-${{ env.PROTOBUF_VERSION }}
run: sudo make install && sudo ldconfig

- name: Prepare C++ Build
if: env.PROTOBUF_VERSION != '2.6.1'
run: mkdir build

- name: Switch to Proto3 Syntax
if: env.PROTOBUF_VERSION != '2.6.1'
run: |
bash convert-to-proto3.sh
rm *.pb2
Expand All @@ -209,10 +213,12 @@ jobs:
echo "VERSION_SUFFIX = .dev`date -u '+%Y%m%d%H%M%S'`" >> VERSION

- name: Configure C++ Build
if: env.PROTOBUF_VERSION != '2.6.1'
working-directory: build
run: cmake ${{ env.PROTOBUF_VARIANT =='' && '-DCMAKE_CXX_STANDARD=17' }} ..

- name: Build C++
if: env.PROTOBUF_VERSION != '2.6.1'
working-directory: build
run: cmake --build . --config Release -j 4

Expand Down