11name : ProtoBuf CI Builds
22
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+
38on :
49 push :
510 branches :
@@ -22,52 +27,58 @@ jobs:
2227
2328 steps :
2429 - name : Checkout OSI
25- uses : actions/checkout@v2
30+ uses : actions/checkout@v4
2631 with :
2732 submodules : true
2833
2934 - name : Setup Python
30- uses : actions/setup-python@v2
35+ uses : actions/setup-python@v5
3136 with :
32- python-version : ' 3.7 '
37+ python-version : ' 3.8 '
3338
34- # cache dependencies
3539 - name : Cache Dependencies
3640 id : cache-depends
37- uses : actions/cache@v3
41+ uses : actions/cache@v4
3842 with :
39- path : protobuf-3.15.8
43+ path : protobuf-${{ env.PROTOBUF_VERSION }}
4044 key : ${{ runner.os }}-v2-depends
4145
42- # Download and build protobuf
43- - name : Download ProtoBuf
46+ - name : Download ProtoBuf ${{ env.PROTOBUF_VERSION }}
4447 if : steps.cache-depends.outputs.cache-hit != 'true'
45- run : curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8 /protobuf-all-3.15.8. tar.gz && tar xzvf protobuf-all-3.15.8 .tar.gz
48+ 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
4649
47- - name : Build ProtoBuf
48- if : steps.cache-depends.outputs.cache-hit != 'true'
49- working-directory : protobuf-3.15.8
50+ - name : Download Abseil ${{ env.ABSEIL_VERSION }}
51+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
52+ 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
53+
54+ - name : Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via autotools
55+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == '-all'
56+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
5057 run : ./configure DIST_LANG=cpp --prefix=/usr && make
5158
52- - name : Install ProtoBuf
53- working-directory : protobuf-3.15.8
59+ - name : Build ProtoBuf ${{ env.PROTOBUF_VERSION }} via cmake
60+ if : steps.cache-depends.outputs.cache-hit != 'true' && env.PROTOBUF_VARIANT == ''
61+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
62+ run : cmake -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF . && cmake --build . --config Release -j 4
63+
64+ - name : Install ProtoBuf ${{ env.PROTOBUF_VERSION }}
65+ working-directory : protobuf-${{ env.PROTOBUF_VERSION }}
5466 run : sudo make install && sudo ldconfig
5567
56- # prepare build
5768 - name : Prepare C++ Build
5869 working-directory : examples
5970 run : mkdir build
6071
61- - name : cmake prepare
72+ - name : Configure C++ Build
6273 working-directory : examples/build
63- run : cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install ..
74+ run : cmake ${{ env.PROTOBUF_VARIANT =='' && '-DCMAKE_CXX_STANDARD=17' }} ..
6475
6576 - name : Build C++
6677 working-directory : examples/build
67- run : cmake --build .
68-
78+ run : cmake --build . --config Release -j 4
79+
6980 - name : Upload build artifacts
70- uses : actions/upload-artifact@v3.1.2
81+ uses : actions/upload-artifact@v4
7182 with :
7283 name : Examples
7384 path : examples/build
@@ -79,12 +90,12 @@ jobs:
7990 if : ${{ github.event.client_payload }}
8091 steps :
8192 - name : Collect previous artifacts
82- uses : actions/download-artifact@v3.0.2
93+ uses : actions/download-artifact@v4
8394 with :
8495 name : Examples
8596 path : examples/build
8697 - name : Zip artifacts
87- uses : TheDoctor0/zip-release@0.6.2
98+ uses : TheDoctor0/zip-release@0.7.6
8899 with :
89100 filename : Examples.zip
90101 path : examples/build
0 commit comments