1
1
name : ProtoBuf CI Builds
2
2
3
+ env :
4
+ PROTOBUF_VERSION : 3.20.1
5
+ PROTOBUF_VARIANT : ' -all' # Use '-all' prior to 22.0, '' after
6
+ ABSEIL_VERSION : 20230802.1
7
+
3
8
on :
4
9
push :
5
10
pull_request :
@@ -13,14 +18,14 @@ jobs:
13
18
14
19
steps :
15
20
- name : Checkout OSI
16
- uses : actions/checkout@v2
21
+ uses : actions/checkout@v4
17
22
with :
18
23
submodules : true
19
24
20
25
- name : Setup Python
21
- uses : actions/setup-python@v2
26
+ uses : actions/setup-python@v5
22
27
with :
23
- python-version : ' 3.7 '
28
+ python-version : ' 3.8 '
24
29
25
30
- name : Install Python Dependencies
26
31
run : python -m pip install --upgrade pip setuptools wheel pyyaml
@@ -32,20 +37,29 @@ jobs:
32
37
id : cache-depends
33
38
uses : actions/cache@v3
34
39
with :
35
- path : protobuf-3.20.1
40
+ path : protobuf-${{ env.PROTOBUF_VERSION }}
36
41
key : ${{ runner.os }}-v2-depends
37
42
38
- - name : Download ProtoBuf
43
+ - name : Download ProtoBuf ${{ env.PROTOBUF_VERSION }}
39
44
if : steps.cache-depends.outputs.cache-hit != 'true'
40
- run : curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1 /protobuf-all-3.20.1. tar.gz && tar xzvf protobuf-all-3.20.1 .tar.gz
45
+ 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
41
46
42
- - name : Build ProtoBuf
43
- if : steps.cache-depends.outputs.cache-hit != 'true'
44
- working-directory : protobuf-3.20.1
47
+ - name : Download Abseil ${{ env.ABSEIL_VERSION }}
48
+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
49
+ 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
50
+
51
+ - name : Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via autotools
52
+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == '-all'
53
+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
45
54
run : ./configure DIST_LANG=cpp --prefix=/usr && make
46
55
47
- - name : Install ProtoBuf
48
- working-directory : protobuf-3.20.1
56
+ - name : Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via cmake
57
+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
58
+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
59
+ run : cmake -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4
60
+
61
+ - name : Install ProtoBuf ${{ env.PROTOBUF_VERSION }}
62
+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
49
63
run : sudo make install && sudo ldconfig
50
64
51
65
- name : Install proto2cpp
@@ -57,17 +71,17 @@ jobs:
57
71
# Versioning
58
72
- name : Get versioning
59
73
id : get_version
60
- run : echo ::set-output name= VERSION:: $(git describe --always)
74
+ run : echo " VERSION= $(git describe --always)" >> $GITHUB_OUTPUT
61
75
62
76
- name : Prepare Documentation Build
63
77
run : |
64
78
sed -i 's/PROJECT_NUMBER\s*= @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@/PROJECT_NUMBER = master (${{ steps.get_version.outputs.VERSION }})/g' doxygen_config.cmake.in
65
- echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-3.20.1 /* */proto2cpp/* */flatbuffers/*" >> doxygen_config.cmake.in
79
+ echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-* /* */proto2cpp/* */flatbuffers/*" >> doxygen_config.cmake.in
66
80
echo "GENERATE_TREEVIEW = YES" >> doxygen_config.cmake.in
67
81
68
82
- name : Configure C++ Build
69
83
working-directory : build
70
- run : cmake -D FILTER_PROTO2CPP_PY_PATH=$GITHUB_WORKSPACE/proto2cpp ..
84
+ run : cmake -D FILTER_PROTO2CPP_PY_PATH=$GITHUB_WORKSPACE/proto2cpp ${{ env.PROTOBUF_VARIANT =='' && '-DCMAKE_CXX_STANDARD=17' }} ..
71
85
72
86
- name : Build C++
73
87
working-directory : build
84
98
85
99
- name : Archive Documentation
86
100
if : ${{ github.event_name == 'pull_request' }}
87
- uses : actions/upload-artifact@v2
101
+ uses : actions/upload-artifact@v4
88
102
with :
89
103
name : linux64-doc
90
104
path : doc/html
@@ -104,36 +118,45 @@ jobs:
104
118
105
119
steps :
106
120
- name : Checkout OSI
107
- uses : actions/checkout@v2
121
+ uses : actions/checkout@v4
108
122
with :
109
123
submodules : true
110
124
111
125
- name : Setup Python
112
- uses : actions/setup-python@v2
126
+ uses : actions/setup-python@v5
113
127
with :
114
- python-version : ' 3.7 '
128
+ python-version : ' 3.8 '
115
129
116
130
- name : Install Python Dependencies
117
131
run : python -m pip install --upgrade pip setuptools wheel pyyaml
118
132
119
133
- name : Cache Dependencies
120
134
id : cache-depends
121
- uses : actions/cache@v2
135
+ uses : actions/cache@v3
122
136
with :
123
- path : protobuf-3.20.1
137
+ path : protobuf-${{ env.PROTOBUF_VERSION }}
124
138
key : ${{ runner.os }}-v2-depends
125
139
126
- - name : Download ProtoBuf
140
+ - name : Download ProtoBuf ${{ env.PROTOBUF_VERSION }}
127
141
if : steps.cache-depends.outputs.cache-hit != 'true'
128
- run : curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1 /protobuf-all-3.20.1. tar.gz && tar xzvf protobuf-all-3.20.1 .tar.gz
142
+ 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
129
143
130
- - name : Build ProtoBuf
131
- if : steps.cache-depends.outputs.cache-hit != 'true'
132
- working-directory : protobuf-3.20.1
144
+ - name : Download Abseil ${{ env.ABSEIL_VERSION }}
145
+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
146
+ 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
147
+
148
+ - name : Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via autotools
149
+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == '-all'
150
+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
133
151
run : ./configure DIST_LANG=cpp --prefix=/usr && make
134
152
135
- - name : Install ProtoBuf
136
- working-directory : protobuf-3.20.1
153
+ - name : Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via cmake
154
+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
155
+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
156
+ run : cmake -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4
157
+
158
+ - name : Install ProtoBuf ${{ env.PROTOBUF_VERSION }}
159
+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
137
160
run : sudo make install && sudo ldconfig
138
161
139
162
- name : Prepare C++ Build
@@ -146,7 +169,7 @@ jobs:
146
169
147
170
- name : Configure C++ Build
148
171
working-directory : build
149
- run : cmake ..
172
+ run : cmake ${{ env.PROTOBUF_VARIANT =='' && '-DCMAKE_CXX_STANDARD=17' }} ..
150
173
151
174
- name : Build C++
152
175
working-directory : build
0 commit comments