| # This workflow will build a Java project with Maven |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| |
| # CPP compiling is too slow, so let's do it in parallel with testing other modules. |
| # As there is no Java client, we just use one JDK. |
| name: C++ Client |
| |
| on: |
| push: |
| branches: |
| - master |
| - "rel/*" |
| - "new_*" |
| paths-ignore: |
| - 'docs/**' |
| - 'site/**' |
| pull_request: |
| branches: |
| - master |
| - "rel/*" |
| - "new_*" |
| paths-ignore: |
| - 'docs/**' |
| - 'site/**' |
| # allow manually run the action: |
| workflow_dispatch: |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: true |
| |
| env: |
| MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 |
| |
| jobs: |
| build: |
| strategy: |
| fail-fast: false |
| max-parallel: 20 |
| matrix: |
| os: [ubuntu-latest, macos-latest] |
| runs-on: ${{ matrix.os}} |
| |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Install CPP Dependencies (Ubuntu) |
| if: matrix.os == 'ubuntu-latest' |
| shell: bash |
| run: sudo apt-get update && sudo apt-get install libboost-all-dev |
| - name: Install CPP Dependencies (Mac)` |
| if: matrix.os == 'macos-latest' |
| shell: bash |
| run: | |
| brew install boost |
| brew install bison |
| echo 'export PATH=/usr/local/opt/bison/bin:$PATH' >> ~/.bash_profile |
| source ~/.bash_profile && export LDFLAGS="-L/usr/local/opt/bison/lib" |
| brew install openssl |
| - name: Cache Maven packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.m2 |
| key: client-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2- |
| - name: Build IoTDB server |
| run: mvn clean package -pl distribution -am -DskipTests |
| - name: Test with Maven |
| run: mvn clean verify -pl iotdb-client/client-cpp -am -P compile-cpp -P cppTest |
| - name: Show test result |
| run: cat iotdb-client/client-cpp/target/build/test/Testing/Temporary/LastTest_*.log |
| |
| build-win: |
| strategy: |
| fail-fast: false |
| max-parallel: 20 |
| matrix: |
| os: [windows-latest] |
| runs-on: ${{ matrix.os}} |
| |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Cache Maven packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.m2 |
| key: client-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2- |
| - name: Install Win_Flex_Bison |
| run: mkdir D:\a\cpp ; ` |
| Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip -OutFile D:\a\cpp\win_flex_bison.zip ; ` |
| [Environment]::SetEnvironmentVariable("Path", $env:Path + ";D:\a\cpp", "User") ; ` |
| - name: Download Boost |
| run: choco install boost-msvc-14.3 --version=1.78.0 |
| - name: Install Boost |
| run: cd C:\local\boost_1_78_0 ; ` |
| .\bootstrap.bat ; ` |
| .\b2.exe |
| - name: Install OpenSSL |
| run: choco install openssl |
| - name: Add Flex and Bison Path and OpenSSL |
| shell: bash |
| run: cd /d/a/cpp && unzip win_flex_bison.zip && mv win_flex.exe flex.exe && mv win_bison.exe bison.exe && echo 'export PATH=/d/a/cpp:$PATH' >> ~/.bash_profile && source ~/.bash_profile |
| - name: Build IoTDB server |
| shell: bash |
| run: source ~/.bash_profile && mvn clean package -pl distribution -am -DskipTests |
| - name: Test with Maven |
| shell: bash |
| run: source ~/.bash_profile && mvn clean verify -pl iotdb-client/client-cpp -am -P compile-cpp -P cppTest -Dboost.include.dir=/c/local/boost_1_78_0 -Dboost.library.dir=/c/local/boost_1_78_0/stage/lib -Dcmake.url="https://github.com/Kitware/CMake/releases/download/v3.21.6/cmake-3.21.6-windows-x86_64.zip" -Dcmake.root.dir=/D/a/iotdb/iotdb/iotdb-client/compile-tools/thrift/target/cmake-3.21.6-windows-x86_64/ -Dcmake.generator="Visual Studio 17 2022" |
| - name: Upload Artifact |
| if: failure() |
| uses: actions/upload-artifact@v3 |
| with: |
| name: cpp-IT-${{ runner.os }} |
| path: iotdb-client/client-cpp/target/build/test/Testing |
| retention-days: 1 |