diff --git a/.github/actions/build-test/macos-x86_64/action.yml b/.github/actions/build-test/macos-x86_64/action.yml new file mode 100644 index 000000000..b2786405f --- /dev/null +++ b/.github/actions/build-test/macos-x86_64/action.yml @@ -0,0 +1,64 @@ +name: Build & Test - macOS - x86-64 + +inputs: + GH_TOKEN: + required: true + BOOST_VERSION: + required: true + WARN_AS_ERR: + required: true + BUILD_TYPE: + required: true + SHARED_LIBS_TOGGLE: + required: true + OPENSSL_TOGGLE: + required: true + RUN_TESTS: + required: true + HAZELCAST_ENTERPRISE_KEY: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: + required: true + +env: + # Not possible to set this as a default + # https://github.com/orgs/community/discussions/46670 + shell: bash + +runs: + using: composite + steps: + - name: Read Config + shell: ${{ env.shell }} + run: cat .github/config.env >> $GITHUB_ENV + + - name: Install Dependencies + shell: ${{ env.shell }} + run: | + sudo ./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }} + brew install openssl@1.1 thrift curl + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.JAVA_DISTRIBUTION }} + + - uses: ./.github/actions/build-test/unix + with: + GH_TOKEN: ${{ inputs.GH_TOKEN }} + BOOST_VERSION: ${{ inputs.BOOST_VERSION }} + THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }} + WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }} + BUILD_TYPE: ${{ inputs.BUILD_TYPE }} + SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }} + OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }} + RUN_TESTS: ${{ inputs.RUN_TESTS }} + HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} diff --git a/.github/actions/build-test/ubuntu-i386/action.yml b/.github/actions/build-test/ubuntu-i386/action.yml new file mode 100644 index 000000000..b510f14a2 --- /dev/null +++ b/.github/actions/build-test/ubuntu-i386/action.yml @@ -0,0 +1,110 @@ +name: Build & Test - Ubuntu - i386 + +inputs: + GH_TOKEN: + required: true + BOOST_VERSION: + required: true + THRIFT_VERSION: + required: true + WARN_AS_ERR: + required: true + BUILD_TYPE: + required: true + SHARED_LIBS_TOGGLE: + required: true + OPENSSL_TOGGLE: + required: true + RUN_TESTS: + required: true + HAZELCAST_ENTERPRISE_KEY: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: + required: true + +env: + # Not possible to set this as a default + # https://github.com/orgs/community/discussions/46670 + shell: bash + +runs: + using: composite + steps: + - name: Read Config + shell: ${{ env.shell }} + run: cat .github/config.env >> $GITHUB_ENV + + # Install Java via `apt`, can't use the `setup-java` action on this image + # `setup-java` is written in TypeScript and requires a compatible Node installation + # Newest available version for this image is Node 8, which is too old for any version to run against + # https://github.com/actions/setup-node/issues/922 + - name: Install Necessary Packages + shell: ${{ env.shell }} + run: | + apt-get update + apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-${{ env.JAVA_VERSION }}-jre-headless gdb curl + + - name: Make sure the target architecture is 32 bit + shell: ${{ env.shell }} + run: | + echo 'int main() { return sizeof(void*) != 4; }' > test.c + gcc test.c -oa + ./a + rm a test.c + + # `apt-get` brings in `3.6` which is too old to be compatible with Java 17 + - name: Install Maven + shell: ${{ env.shell }} + run: | + install_dir="/opt/maven" + mkdir ${install_dir} + curl \ + --fail \ + --silent \ + --show-error \ + --location \ + https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${{ env.MAVEN_VERSION }}/apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz | + tar \ + --extract \ + --gzip \ + --strip-components=1 \ + --directory ${install_dir} + echo "${install_dir}/bin" >> $GITHUB_PATH + + - name: Install Boost + shell: ${{ env.shell }} + run: | + ./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }} + + - name: Install Thrift + shell: ${{ env.shell }} + run: | + ./scripts/install-thrift.sh ${{ inputs.THRIFT_VERSION }} + + - name: Configure Resources + if: ${{ inputs.run_tests }} + shell: ${{ env.shell }} + run: | + ulimit -c unlimited + + sh -c "echo 'core' > /proc/sys/kernel/core_pattern" + sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" + + - uses: ./.github/actions/build-test/unix + with: + GH_TOKEN: ${{ inputs.GH_TOKEN }} + BOOST_VERSION: ${{ inputs.BOOST_VERSION }} + THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }} + WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }} + BUILD_TYPE: ${{ inputs.BUILD_TYPE }} + SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }} + OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }} + RUN_TESTS: ${{ inputs.RUN_TESTS }} + HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} diff --git a/.github/actions/build-test/ubuntu-x86_64/action.yml b/.github/actions/build-test/ubuntu-x86_64/action.yml new file mode 100644 index 000000000..49ec85ba9 --- /dev/null +++ b/.github/actions/build-test/ubuntu-x86_64/action.yml @@ -0,0 +1,85 @@ +name: Build & Test - Ubuntu - x86-64 + +inputs: + GH_TOKEN: + required: true + BOOST_VERSION: + required: true + THRIFT_VERSION: + required: true + WARN_AS_ERR: + required: true + BUILD_TYPE: + required: true + SHARED_LIBS_TOGGLE: + required: true + OPENSSL_TOGGLE: + required: true + RUN_TESTS: + required: true + HAZELCAST_ENTERPRISE_KEY: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: + required: true + +env: + # Not possible to set this as a default + # https://github.com/orgs/community/discussions/46670 + shell: bash + +runs: + using: composite + steps: + - name: Install Necessary Packages + shell: ${{ env.shell }} + run: | + sudo apt-get update + sudo apt-get install -y net-tools libssl-dev gdb curl + + - name: Read Config + shell: ${{ env.shell }} + run: cat .github/config.env >> $GITHUB_ENV + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.JAVA_DISTRIBUTION }} + + - name: Install Boost + shell: ${{ env.shell }} + run: | + sudo ./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }} + + - name: Install Thrift + shell: ${{ env.shell }} + run: | + sudo ./scripts/install-thrift.sh ${{ inputs.THRIFT_VERSION }} + + - name: Configure Resources + if: ${{ inputs.run_tests }} + shell: ${{ env.shell }} + run: | + ulimit -c unlimited + + sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern" + sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" + + - uses: ./.github/actions/build-test/unix + with: + GH_TOKEN: ${{ inputs.GH_TOKEN }} + BOOST_VERSION: ${{ inputs.BOOST_VERSION }} + THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }} + WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }} + BUILD_TYPE: ${{ inputs.BUILD_TYPE }} + SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }} + OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }} + RUN_TESTS: ${{ inputs.RUN_TESTS }} + HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} diff --git a/.github/actions/build-test/unix/action.yml b/.github/actions/build-test/unix/action.yml new file mode 100644 index 000000000..1f4b06744 --- /dev/null +++ b/.github/actions/build-test/unix/action.yml @@ -0,0 +1,67 @@ +name: Build & Test - Unix + +inputs: + GH_TOKEN: + required: true + BOOST_VERSION: + required: true + THRIFT_VERSION: + required: true + WARN_AS_ERR: + required: true + BUILD_TYPE: + required: true + SHARED_LIBS_TOGGLE: + required: true + OPENSSL_TOGGLE: + required: true + RUN_TESTS: + required: true + HAZELCAST_ENTERPRISE_KEY: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: + required: true + +env: + # Not possible to set this as a default + # https://github.com/orgs/community/discussions/46670 + shell: bash + +runs: + using: composite + steps: + - name: Download hazelcast-enterprise-tests.jar + shell: ${{ env.shell }} + run: | + curl -H "Authorization: token ${{ inputs.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar + + - name: Build & Install + env: + BUILD_DIR: build + INSTALL: ON + WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }} + shell: ${{ env.shell }} + run: | + ./scripts/build-unix.sh \ + -DCMAKE_BUILD_TYPE=${{ inputs.BUILD_TYPE }} \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ + -DBUILD_SHARED_LIBS=${{ inputs.SHARED_LIBS_TOGGLE }} \ + -DWITH_OPENSSL=${{ inputs.OPENSSL_TOGGLE }} \ + -DBUILD_TESTS=ON \ + -DBUILD_EXAMPLES=OFF + + - name: Test + if: ${{ inputs.run_tests }} + env: + BUILD_DIR: build + HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} + shell: ${{ env.shell }} + run: | + ./scripts/test-unix.sh diff --git a/.github/actions/build-test/windows/action.yml b/.github/actions/build-test/windows/action.yml new file mode 100644 index 000000000..4b17a80e1 --- /dev/null +++ b/.github/actions/build-test/windows/action.yml @@ -0,0 +1,170 @@ +name: Build & Test - Windows + +inputs: + GH_TOKEN: + required: true + BOOST_VERSION: + required: true + THRIFT_VERSION: + required: true + BUILD_TYPE: + required: true + SHARED_LIBS_TOGGLE: + required: true + OPENSSL_TOGGLE: + required: true + ARCH_CHOCO_OPTIONS: + required: true + ARCH_ADDRESS_MODEL: + required: true + ARCH_CMAKE: + required: true + INSTALL_BOOST: + required: true + INSTALL_THRIFT: + required: true + BOOST_URL: + required: true + BOOST_ARCHIVE_NAME: + required: true + BOOST_FOLDER_NAME: + required: true + BOOST_INCLUDE_FOLDER: + required: true + RUN_TESTS: + required: true + HAZELCAST_ENTERPRISE_KEY: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: + required: true + +env: + # Not possible to set this as a default + # https://github.com/orgs/community/discussions/46670 + shell: pwsh + +runs: + using: composite + steps: + - name: Read Config + shell: bash + run: cat .github/config.env >> $GITHUB_ENV + + - name: Download hazelcast-enterprise-tests.jar + shell: ${{ env.shell }} + run: | + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest ` + https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar ` + -Headers @{"Authorization"="token ${{ inputs.GH_TOKEN }}"} ` + -OutFile hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar + + - name: Install SysInternals + shell: ${{ env.shell }} + run: | + Invoke-WebRequest ` + "https://download.sysinternals.com/files/SysinternalsSuite.zip" ` + -OutFile "sys-internals.zip" ` + -UserAgent "''" + Expand-Archive sys-internals.zip -DestinationPath sys-internals + + - uses: nick-fields/retry@v2 + name: Install OpenSSL + if: inputs.OPENSSL_TOGGLE == 'ON' + with: + timeout_minutes: 10 + max_attempts : 4 + retry_on: error + shell: ${{ env.shell }} + command: | + choco install openssl ${{ inputs.ARCH_CHOCO_OPTIONS }} + Invoke-WebRequest ` + "https://curl.se/ca/cacert.pem" ` + -OutFile "C:\cacert.pem" + + - if: ${{ inputs.INSTALL_BOOST != 'false' }} + name: Install Boost + shell: ${{ env.shell }} + run: | + Invoke-WebRequest ` + "${{ inputs.BOOST_URL }}" ` + -OutFile "${{ inputs.BOOST_ARCHIVE_NAME }}" ` + -UserAgent "''" + tar xzf ${{ inputs.BOOST_ARCHIVE_NAME }} + rm ${{ inputs.BOOST_ARCHIVE_NAME }} + cd ${{ inputs.BOOST_FOLDER_NAME }} + .\bootstrap.bat + .\b2 address-model=${{ inputs.ARCH_ADDRESS_MODEL }} --with-atomic --with-thread --with-chrono install + cd .. + Remove-Item ${{ inputs.BOOST_FOLDER_NAME }} -Recurse -Force + + - if: ${{ inputs.INSTALL_THRIFT != 'false' }} + name: Install Thrift + shell: ${{ env.shell }} + run: | + Invoke-WebRequest ` + "https://archive.apache.org/dist/thrift/${{ inputs.THRIFT_VERSION }}/thrift-${{ inputs.THRIFT_VERSION }}.tar.gz" ` + -OutFile "thrift-${{ inputs.THRIFT_VERSION }}.tar.gz" + tar xzf thrift-${{ inputs.THRIFT_VERSION }}.tar.gz + rm thrift-${{ inputs.THRIFT_VERSION }}.tar.gz + cd thrift-${{ inputs.THRIFT_VERSION }}\build + cmake .. -A ${{ inputs.ARCH_CMAKE }} ` + -DBUILD_COMPILER=OFF -DBUILD_TESTING=OFF -DBUILD_TUTORIALS=OFF -DBUILD_LIBRARIES=ON ` + -DBUILD_CPP=ON -DBUILD_AS3=OFF -DBUILD_C_GLIB=OFF -DBUILD_JAVA=OFF -DBUILD_PYTHON=OFF ` + -DBUILD_HASKELL=OFF -DWITH_OPENSSL=OFF -DWITH_LIBEVENT=OFF -DWITH_ZLIB=OFF ` + -DWITH_QT5=OFF -DBoost_INCLUDE_DIR=${{ inputs.BOOST_INCLUDE_FOLDER }} -DCMAKE_INSTALL_PREFIX=C:\Thrift + cmake --build . --target install --config ${{ inputs.BUILD_TYPE }} + mkdir C:\Thrift\bin + cd ../.. + Remove-Item thrift-${{ inputs.THRIFT_VERSION }} -Recurse -Force + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.JAVA_DISTRIBUTION }} + + - name: Build & Install + env: + BUILD_DIR: build + BUILD_CONFIGURATION: ${{ inputs.BUILD_TYPE }} + BIT_VERSION: ${{ inputs.ARCH_ADDRESS_MODEL }} + INSTALL: ON + CXXFLAGS: '/I C:\Thrift\include\' + shell: ${{ env.shell }} + run: | + .\scripts\build-windows.bat ` + -DCMAKE_PREFIX_PATH="C:\Boost;C:\Thrift" ` + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\destination ` + -DBUILD_SHARED_LIBS=${{ inputs.SHARED_LIBS_TOGGLE }} ` + -DWITH_OPENSSL=${{ inputs.OPENSSL_TOGGLE }} ` + -DBUILD_TESTS=ON ` + -DBUILD_EXAMPLES=OFF + + - name: Test + if: ${{ inputs.run_tests }} + env: + BUILD_DIR: build + BUILD_CONFIGURATION: ${{ inputs.BUILD_TYPE }} + HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} + SSL_CERT_FILE: 'C:\cacert.pem' + shell: ${{ env.shell }} + run: | + $dump = start-process -NoNewWindow sys-internals\procdump.exe {-accepteula -e -ma -w client_test.exe crash.dmp} + .\scripts\test-windows.bat + $dump | wait-process + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: dump-${{ env.JOB_NAME }} + path: | + **/*.pdb + *.dmp diff --git a/.github/actions/coverage-report/action.yml b/.github/actions/coverage-report/action.yml new file mode 100644 index 000000000..6b4b3a966 --- /dev/null +++ b/.github/actions/coverage-report/action.yml @@ -0,0 +1,104 @@ +name: Coverage Report + +inputs: + GH_TOKEN: + required: true + BOOST_VERSION: + required: true + THRIFT_VERSION: + required: true + RUN_TESTS: + required: true + HAZELCAST_ENTERPRISE_KEY: + required: true + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: + required: true + +env: + # Not possible to set this as a default + # https://github.com/orgs/community/discussions/46670 + shell: bash + +runs: + using: composite + steps: + - name: Read Config + shell: ${{ env.shell }} + run: cat .github/config.env >> $GITHUB_ENV + + - name: Install Necessary Packages + shell: ${{ env.shell }} + run: | + sudo apt-get update + sudo apt-get install -y net-tools libssl-dev gdb gcovr lcov curl + + - name: Download hazelcast-enterprise-tests.jar + shell: ${{ env.shell }} + run: | + curl -H "Authorization: token ${{ inputs.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar + + - name: Install Boost + shell: ${{ env.shell }} + run: | + sudo ./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }} + + - name: Install Thrift + shell: ${{ env.shell }} + run: | + sudo ./scripts/install-thrift.sh ${{ inputs.THRIFT_VERSION }} + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: ${{ env.JAVA_DISTRIBUTION }} + + - name: Build + env: + BUILD_DIR: build + COVERAGE: ON + shell: ${{ env.shell }} + run: | + ./scripts/build-unix.sh \ + -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_SHARED_LIBS=ON \ + -DWITH_OPENSSL=ON \ + -DBUILD_TESTS=ON \ + -DBUILD_EXAMPLES=OFF + + - name: Test + if: ${{ inputs.run_tests }} + env: + BUILD_DIR: build + HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }} + AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} + HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} + shell: ${{ env.shell }} + run: | + ulimit -c unlimited + sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern" + sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" + ./scripts/test-unix.sh + + - name: Collect coverage info + shell: ${{ env.shell }} + run: | + # collect and list coverage info + lcov --capture --directory . --no-external -o coverage.info \ + --include "`pwd`/hazelcast/*" --exclude "`pwd`/hazelcast/test/*" + lcov --list coverage.info + # generate HTML views + genhtml coverage.info --output-directory=coverage-html-reports + + - name: Upload HTML views as artifact + uses: actions/upload-artifact@v2 + with: + name: coverage-report + path: | + coverage.info + coverage-html-reports diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index d1b7a09eb..6bb2adb33 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -102,7 +102,7 @@ jobs: # run for code-coverage and upload the result as an artifact. code-coverage: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: get-refs name: Code Coverage @@ -113,68 +113,16 @@ jobs: ref: ${{ needs.get-refs.outputs.ref }} token: ${{ secrets.GH_TOKEN }} - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Install Necessary Packages - run: | - sudo apt-get update - sudo apt-get install -y net-tools libssl-dev gdb gcovr curl - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - name: Install Boost - run: | - sudo ./scripts/install-boost.sh ${{ env.boost_version }} - - name: Install Thrift - run: | - sudo ./scripts/install-thrift.sh ${{ env.thrift_version }} - - - name: Setup JDK - uses: actions/setup-java@v4 + - uses: ./.github/actions/coverage-report with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DISTRIBUTION }} - - - name: Build - env: - BUILD_DIR: build - COVERAGE: ON - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_SHARED_LIBS=ON \ - -DWITH_OPENSSL=ON \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - name: Test - if: ${{ env.run_tests }} - env: - BUILD_DIR: build + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ env.boost_version }} + THRIFT_VERSION: ${{ env.thrift_version }} + RUN_TESTS: ${{ env.run_tests }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ulimit -c unlimited - sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern" - sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" - ./scripts/test-unix.sh - - name: Collect coverage info - run: | - # collect and list coverage info - lcov --capture --directory . --no-external -o coverage.info \ - --include "`pwd`/hazelcast/*" --exclude "`pwd`/hazelcast/test/*" - lcov --list coverage.info - # generate HTML views - genhtml coverage.info --output-directory=coverage-html-reports - - name: Upload HTML views as artifact - uses: actions/upload-artifact@v2 - with: - name: coverage-report - path: | - coverage.info - coverage-html-reports Ubuntu-i386: needs: get-refs @@ -213,96 +161,20 @@ jobs: ref: ${{ needs.get-refs.outputs.ref }} token: ${{ secrets.GH_TOKEN }} - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - # Install Java via `apt`, can't use the `setup-java` action on this image - # `setup-java` is written in TypeScript and requires a compatible Node installation - # Newest available version for this image is Node 8, which is too old for any version to run against - # https://github.com/actions/setup-node/issues/922 - - name: Install Necessary Packages - run: | - apt-get update - apt-get install -y build-essential cmake curl git libssl-dev net-tools openjdk-${{ env.JAVA_VERSION }}-jre-headless gdb curl - - - name: Make sure the target architecture is 32 bit - run: | - echo 'int main() { return sizeof(void*) != 4; }' > test.c - gcc test.c -oa - ./a - rm a test.c - - - name: Checkout Code - uses: actions/checkout@v1 + - uses: ./.github/actions/build-test/ubuntu-i386 with: - ref: ${{ needs.get-refs.outputs.ref }} - token: ${{ secrets.GH_TOKEN }} - - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - # `apt-get` brings in `3.6` which is too old to be compatible with Java 17 - - name: Install Maven - run: | - install_dir="/opt/maven" - mkdir ${install_dir} - curl \ - --fail \ - --silent \ - --show-error \ - --location \ - https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${{ env.MAVEN_VERSION }}/apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz | - tar \ - --extract \ - --gzip \ - --strip-components=1 \ - --directory ${install_dir} - echo "${install_dir}/bin" >> $GITHUB_PATH - - - name: Test Maven - run: | - mvn --version - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Install Boost - run: | - ./scripts/install-boost.sh ${{ env.boost_version }} - - - name: Install Thrift - run: | - ./scripts/install-thrift.sh ${{ env.thrift_version }} - - - name: Build & Install - env: - BUILD_DIR: build - INSTALL: ON + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ env.boost_version }} + THRIFT_VERSION: ${{ env.thrift_version }} WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }} - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type.type }} \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} \ - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - - name: Test - if: ${{ env.run_tests }} - env: - BUILD_DIR: build + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + RUN_TESTS: ${{ env.run_tests }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ulimit -c unlimited - echo 'core' > /proc/sys/kernel/core_pattern - echo '1' > /proc/sys/kernel/core_uses_pid - - ./scripts/test-unix.sh Ubuntu-x86_64: @@ -333,65 +205,26 @@ jobs: name: ubuntu-x64-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }}) steps: - - name: Install Necessary Packages - run: | - sudo apt-get update - sudo apt-get install -y net-tools libssl-dev gdb curl - uses: actions/checkout@v3 with: ref: ${{ needs.get-refs.outputs.ref }} token: ${{ secrets.GH_TOKEN }} - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Install Boost - run: | - sudo ./scripts/install-boost.sh ${{env.boost_version}} - - - name: Install Thrift - run: | - sudo ./scripts/install-thrift.sh ${{env.thrift_version}} - - - name: Setup JDK - uses: actions/setup-java@v4 + - uses: ./.github/actions/build-test/ubuntu-x86_64 with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DISTRIBUTION }} - - - name: Build & Install - env: - BUILD_DIR: build - INSTALL: ON + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ env.boost_version }} + THRIFT_VERSION: ${{ env.thrift_version }} WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }} - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type.type }} \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} \ - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - - name: Test - if: ${{ env.run_tests }} - env: - BUILD_DIR: build + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + RUN_TESTS: ${{ env.run_tests }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ulimit -c unlimited - sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern" - sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" - - ./scripts/test-unix.sh Windows: needs: get-refs @@ -429,109 +262,29 @@ jobs: ref: ${{ needs.get-refs.outputs.ref }} token: ${{ secrets.GH_TOKEN }} - - name: Read Config - shell: bash - run: cat .github/config.env >> $GITHUB_ENV - - - name: Download hazelcast-enterprise-tests.jar - shell: pwsh - run: | - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - Invoke-WebRequest https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar -Headers @{"Authorization"="token ${{ secrets.GH_TOKEN }}"} -OutFile hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - name: Install SysInternals - run: | - Invoke-WebRequest ` - "https://download.sysinternals.com/files/SysinternalsSuite.zip" ` - -OutFile "sys-internals.zip" ` - -UserAgent "''" - Expand-Archive sys-internals.zip -DestinationPath sys-internals - ls sys-internals - - uses: nick-fields/retry@v2 - name: Install OpenSSL - if: matrix.with_openssl.toggle == 'ON' + - uses: ./.github/actions/build-test/windows with: - timeout_minutes: 10 - max_attempts : 4 - retry_on: error - command: | - choco install openssl ${{ matrix.arch.choco_options }} - Invoke-WebRequest ` - "https://curl.se/ca/cacert.pem" ` - -OutFile "C:\cacert.pem" - - name: Install Boost - run: | - Invoke-WebRequest ` - "${{ env.boost_url }}" ` - -OutFile "${{ env.boost_archive_name }}" ` - -UserAgent "''" - tar xzf ${{ env.boost_archive_name }} - rm ${{ env.boost_archive_name }} - cd ${{ env.boost_folder_name }} - .\bootstrap.bat - .\b2 address-model=${{ matrix.arch.address_model }} --with-atomic --with-thread --with-chrono install - cd .. - Remove-Item ${{ env.boost_folder_name }} -Recurse -Force - - name: Install Thrift - run: | - Invoke-WebRequest ` - "https://archive.apache.org/dist/thrift/0.13.0/thrift-0.13.0.tar.gz" ` - -OutFile "thrift-0.13.0.tar.gz" - tar xzf thrift-0.13.0.tar.gz - rm thrift-0.13.0.tar.gz - cd thrift-0.13.0\build - cmake .. -A ${{ matrix.arch.cmake }} ` - -DBUILD_COMPILER=OFF -DBUILD_TESTING=OFF -DBUILD_TUTORIALS=OFF -DBUILD_LIBRARIES=ON ` - -DBUILD_CPP=ON -DBUILD_AS3=OFF -DBUILD_C_GLIB=OFF -DBUILD_JAVA=OFF -DBUILD_PYTHON=OFF ` - -DBUILD_HASKELL=OFF -DWITH_OPENSSL=OFF -DWITH_LIBEVENT=OFF -DWITH_ZLIB=OFF ` - -DWITH_QT5=OFF -DBoost_INCLUDE_DIR=${{ env.boost_include_folder }} -DCMAKE_INSTALL_PREFIX=C:\Thrift - cmake --build . --target install --config ${{ matrix.build_type }} - mkdir C:\Thrift\bin - cd ../.. - Remove-Item thrift-0.13.0 -Recurse -Force - - - name: Setup JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DISTRIBUTION }} - - - name: Build & Install - env: - BUILD_DIR: build - BUILD_CONFIGURATION: ${{ matrix.build_type }} - BIT_VERSION: ${{ matrix.arch.address_model }} - INSTALL: ON - CXXFLAGS: '/I C:\Thrift\include\' - run: | - .\scripts\build-windows.bat ` - -DCMAKE_PREFIX_PATH="C:\Boost;C:\Thrift" ` - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\destination ` - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} ` - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} ` - -DBUILD_TESTS=ON ` - -DBUILD_EXAMPLES=OFF - - name: Test - if: ${{ env.run_tests }} - env: - BUILD_DIR: build - BUILD_CONFIGURATION: ${{ matrix.build_type }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ env.boost_version }} + THRIFT_VERSION: ${{ env.thrift_version }} + BUILD_TYPE: ${{ matrix.build_type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + ARCH_CHOCO_OPTIONS: ${{ matrix.arch.choco_options }} + ARCH_ADDRESS_MODEL: ${{ matrix.arch.address_model }} + ARCH_CMAKE: ${{ matrix.arch.cmake }} + INSTALL_BOOST: true + BOOST_URL: ${{ env.boost_url }} + BOOST_ARCHIVE_NAME: ${{ env.boost_archive_name }} + BOOST_FOLDER_NAME: ${{ env.boost_folder_name }} + BOOST_INCLUDE_FOLDER: ${{ env.boost_include_folder }} + INSTALL_THRIFT: true + RUN_TESTS: ${{ env.run_tests }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - SSL_CERT_FILE: 'C:\cacert.pem' - run: | - $dump = start-process -NoNewWindow sys-internals\procdump.exe {-accepteula -e -ma -w client_test.exe crash.dmp} - .\scripts\test-windows.bat - $dump | wait-process - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: dump-${{ env.JOB_NAME }} - path: | - **/*.pdb - *.dmp - + macOS-x86_64: needs: get-refs strategy: @@ -567,44 +320,16 @@ jobs: ref: ${{ needs.get-refs.outputs.ref }} token: ${{ secrets.GH_TOKEN }} - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Install Dependencies - run: | - brew install openssl@1.1 thrift curl - sudo ./scripts/install-boost.sh ${{env.boost_version}} - - - name: Setup JDK - uses: actions/setup-java@v4 + - uses: ./.github/actions/build-test/macos-x86_64 with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DISTRIBUTION }} - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Build & Install - env: - BUILD_DIR: build - INSTALL: ON + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ env.boost_version }} WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }} - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type.type }} \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} \ - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - name: Test - if: ${{ env.run_tests }} - env: - BUILD_DIR: build + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + RUN_TESTS: ${{ env.run_tests }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ./scripts/test-unix.sh diff --git a/.github/workflows/coverage-report.yaml b/.github/workflows/coverage-report.yaml index acb71b0e6..bfb0290fc 100644 --- a/.github/workflows/coverage-report.yaml +++ b/.github/workflows/coverage-report.yaml @@ -7,74 +7,23 @@ on: jobs: coverage: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Create and upload coverage steps: - name: Checkout code uses: actions/checkout@v2 - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Install Necessary Packages - run: | - sudo apt-get update - sudo apt-get install -y net-tools libssl-dev gdb gcovr curl - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Install Boost - run: | - sudo ./scripts/install-boost.sh 1.78.0 - - - name: Install Thrift - run: | - sudo ./scripts/install-thrift.sh 0.13.0 - - - name: Build - env: - BUILD_DIR: build - COVERAGE: ON - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_SHARED_LIBS=ON \ - -DWITH_OPENSSL=ON \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - - name: Test - env: - BUILD_DIR: build + - uses: ./.github/actions/coverage-report + with: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: 1.78.0 + THRIFT_VERSION: 0.13.0 + RUN_TESTS: true HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ulimit -c unlimited - sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern" - sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" - ./scripts/test-unix.sh - - - name: Collect coverage info - run: | - # collect and list coverage info - lcov --capture --directory . --no-external -o coverage.info \ - --include "`pwd`/hazelcast/*" --exclude "`pwd`/hazelcast/test/*" - lcov --list coverage.info - # generate HTML views - genhtml coverage.info --output-directory=coverage-html-reports - - - name: Upload HTML views as artifact - uses: actions/upload-artifact@v2 - with: - name: coverage-report - path: | - coverage.info - coverage-html-reports - name: Publish on Codecov uses: codecov/codecov-action@v2 diff --git a/.github/workflows/nightly-macos-x86_64.yml b/.github/workflows/nightly-macos-x86_64.yml index 9aec26852..058ef9dc5 100644 --- a/.github/workflows/nightly-macos-x86_64.yml +++ b/.github/workflows/nightly-macos-x86_64.yml @@ -49,42 +49,19 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Install Dependencies - run: | - brew install openssl@1.1 thrift curl - ./scripts/install-boost.sh ${{matrix.boost.version}} - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Build & Install - env: - BUILD_DIR: build - INSTALL: ON + - uses: ./.github/actions/build-test/macos-x86_64 + with: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ matrix.boost.version }} WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }} - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type.type }} \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} \ - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - - name: Test - if: ${{ inputs.run_tests || github.event_name == 'schedule' }} - env: - BUILD_DIR: build + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + RUN_TESTS: ${{ inputs.run_tests || github.event_name == 'schedule' }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ./scripts/test-unix.sh - name: Verify Installation env: diff --git a/.github/workflows/nightly-ubuntu-i386.yml b/.github/workflows/nightly-ubuntu-i386.yml index facfb25fe..147e1b49c 100644 --- a/.github/workflows/nightly-ubuntu-i386.yml +++ b/.github/workflows/nightly-ubuntu-i386.yml @@ -48,87 +48,20 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - # Install Java via `apt`, can't use the `setup-java` action on this image - # `setup-java` is written in TypeScript and requires a compatible Node installation - # Newest available version for this image is Node 8, which is too old for any version to run against - # https://github.com/actions/setup-node/issues/922 - - name: Install Necessary Packages - run: | - apt-get update - apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-${{ env.JAVA_VERSION }}-jre-headless gdb curl - - - name: Make sure the target architecture is 32 bit - run: | - echo 'int main() { return sizeof(void*) != 4; }' > test.c - gcc test.c -oa - ./a - rm a test.c - - # `apt-get` brings in `3.6` which is too old to be compatible with Java 17 - - name: Install Maven - run: | - install_dir="/opt/maven" - mkdir ${install_dir} - curl \ - --fail \ - --silent \ - --show-error \ - --location \ - https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${{ env.MAVEN_VERSION }}/apa${{ env.MAVEN_VERSION }}n_version}-bin.tar.gz | - tar \ - --extract \ - --gzip \ - --strip-components=1 \ - --directory ${install_dir} - echo "${install_dir}/bin" >> $GITHUB_PATH - - - name: Test Maven - run: | - mvn --version - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Install Boost - run: | - ./scripts/install-boost.sh ${{matrix.boost.version}} - - - name: Install Thrift - run: | - ./scripts/install-thrift.sh 0.13.0 - - - name: Build & Install - env: - BUILD_DIR: build - INSTALL: ON + - uses: ./.github/actions/build-test/ubuntu-x86_64 + with: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ matrix.boost.version }} + THRIFT_VERSION: 0.13.0 WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }} - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type.type }} \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} \ - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - - name: Test - if: ${{ inputs.run_tests || github.event_name == 'schedule' }} - env: - BUILD_DIR: build + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + RUN_TESTS: ${{ inputs.run_tests || github.event_name == 'schedule' }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ulimit -c unlimited - echo 'core' > /proc/sys/kernel/core_pattern - echo '1' > /proc/sys/kernel/core_uses_pid - - ./scripts/test-unix.sh - name: Verify Installation env: diff --git a/.github/workflows/nightly-ubuntu-x86_64.yml b/.github/workflows/nightly-ubuntu-x86_64.yml index 921e7f626..651f32d2a 100644 --- a/.github/workflows/nightly-ubuntu-x86_64.yml +++ b/.github/workflows/nightly-ubuntu-x86_64.yml @@ -44,56 +44,22 @@ jobs: (${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{matrix.boost.version}}, ${{ matrix.with_openssl.name }}) steps: - - name: Install Necessary Packages - run: | - sudo apt-get update - sudo apt-get install -y net-tools libssl-dev gdb curl - - uses: actions/checkout@v2 - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Download hazelcast-enterprise-tests.jar - run: | - curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Install Boost - run: | - sudo ./scripts/install-boost.sh ${{matrix.boost.version}} - - - name: Install Thrift - run: | - sudo ./scripts/install-thrift.sh 0.13.0 - - - name: Build & Install - env: - BUILD_DIR: build - INSTALL: ON + - uses: ./.github/actions/build-test/ubuntu-x86_64 + with: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ matrix.boost.version }} + THRIFT_VERSION: 0.13.0 WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }} - run: | - ./scripts/build-unix.sh \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type.type }} \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \ - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} \ - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} \ - -DBUILD_TESTS=ON \ - -DBUILD_EXAMPLES=OFF - - - name: Test - if: ${{ inputs.run_tests || github.event_name == 'schedule' }} - env: - BUILD_DIR: build + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + RUN_TESTS: ${{ inputs.run_tests || github.event_name == 'schedule' }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - run: | - ulimit -c unlimited - sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern" - sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid" - - ./scripts/test-unix.sh - name: Verify Installation env: diff --git a/.github/workflows/nightly-windows.yml b/.github/workflows/nightly-windows.yml index d39b781d8..ca305d23a 100644 --- a/.github/workflows/nightly-windows.yml +++ b/.github/workflows/nightly-windows.yml @@ -77,37 +77,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Config - run: cat .github/config.env >> $GITHUB_ENV - - - name: Download hazelcast-enterprise-tests.jar - shell: pwsh - run: | - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - Invoke-WebRequest https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar -Headers @{"Authorization"="token ${{ secrets.GH_TOKEN }}"} -OutFile hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar - - - name: Install SysInternals - run: | - Invoke-WebRequest ` - "https://download.sysinternals.com/files/SysinternalsSuite.zip" ` - -OutFile "sys-internals.zip" ` - -UserAgent "''" - Expand-Archive sys-internals.zip -DestinationPath sys-internals - ls sys-internals - - - uses: nick-fields/retry@v2 - name: Install OpenSSL - if: matrix.with_openssl.toggle == 'ON' - with: - timeout_minutes: 10 - max_attempts : 4 - retry_on: error - command: | - choco install openssl ${{ matrix.arch.choco_options }} - Invoke-WebRequest ` - "https://curl.se/ca/cacert.pem" ` - -OutFile "C:\cacert.pem" - - name: Cache Boost Version id: cache-boost uses: actions/cache@v3 @@ -116,21 +85,6 @@ jobs: key: ${{ matrix.vc_boost.name }}-${{ matrix.arch.address_model }}-${{ matrix.build_type }} restore-keys: | ${{ matrix.vc_boost.name }}-${{ matrix.arch.address_model }}-${{ matrix.build_type }} - - - if: ${{ steps.cache-boost.outputs.cache-hit != 'true' }} - name: Install Boost - run: | - Invoke-WebRequest ` - "${{ matrix.vc_boost.boost_url }}" ` - -OutFile "${{ matrix.vc_boost.boost_archive_name }}" ` - -UserAgent "''" - tar xzf ${{ matrix.vc_boost.boost_archive_name }} - rm ${{ matrix.vc_boost.boost_archive_name }} - cd ${{ matrix.vc_boost.boost_folder_name }} - .\bootstrap.bat - .\b2 address-model=${{ matrix.arch.address_model }} --with-atomic --with-thread --with-chrono install - cd .. - Remove-Item ${{ matrix.vc_boost.boost_folder_name }} -Recurse -Force - name: Cache Thrift Version id: cache-thrift @@ -140,64 +94,29 @@ jobs: key: ${{ matrix.vc_boost.image }}-${{ matrix.arch.address_model }}-thrift-0.13-${{ matrix.build_type }} restore-keys: | ${{ matrix.vc_boost.image }}-${{ matrix.arch.address_model }}-thrift-0.13-${{ matrix.build_type }} - - - if: ${{ steps.cache-thrift.outputs.cache-hit != 'true' }} - name: Install Thrift - run: | - Invoke-WebRequest ` - "https://archive.apache.org/dist/thrift/0.13.0/thrift-0.13.0.tar.gz" ` - -OutFile "thrift-0.13.0.tar.gz" - tar xzf thrift-0.13.0.tar.gz - rm thrift-0.13.0.tar.gz - cd thrift-0.13.0\build - cmake .. -A ${{ matrix.arch.cmake }} ` - -DBUILD_COMPILER=OFF -DBUILD_TESTING=OFF -DBUILD_TUTORIALS=OFF -DBUILD_LIBRARIES=ON ` - -DBUILD_CPP=ON -DBUILD_AS3=OFF -DBUILD_C_GLIB=OFF -DBUILD_JAVA=OFF -DBUILD_PYTHON=OFF ` - -DBUILD_HASKELL=OFF -DWITH_OPENSSL=OFF -DWITH_LIBEVENT=OFF -DWITH_ZLIB=OFF ` - -DWITH_QT5=OFF -DBoost_INCLUDE_DIR=${{ matrix.vc_boost.boost_include_folder }} -DCMAKE_INSTALL_PREFIX=C:\Thrift - cmake --build . --target install --config ${{ matrix.build_type }} - mkdir C:\Thrift\bin - cd ../.. - Remove-Item thrift-0.13.0 -Recurse -Force - - - name: Build & Install - env: - BUILD_DIR: build - BUILD_CONFIGURATION: ${{ matrix.build_type }} - BIT_VERSION: ${{ matrix.arch.address_model }} - INSTALL: ON - CXXFLAGS: '/I C:\Thrift\include\' - run: | - .\scripts\build-windows.bat ` - -DCMAKE_PREFIX_PATH="C:\Boost;C:\Thrift" ` - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\destination ` - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs.toggle }} ` - -DWITH_OPENSSL=${{ matrix.with_openssl.toggle }} ` - -DBUILD_TESTS=ON ` - -DBUILD_EXAMPLES=OFF - - name: Test - if: ${{ inputs.run_tests || github.event_name == 'schedule' }} - env: - BUILD_DIR: build - BUILD_CONFIGURATION: ${{ matrix.build_type }} + - uses: ./.github/actions/build-test/windows + with: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + BOOST_VERSION: ${{ matrix.boost.version }} + THRIFT_VERSION: 0.13.0 + BUILD_TYPE: ${{ matrix.build_type.type }} + SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }} + OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }} + ARCH_CHOCO_OPTIONS: ${{ matrix.arch.choco_options }} + ARCH_ADDRESS_MODEL: ${{ matrix.arch.address_model }} + ARCH_CMAKE: ${{ matrix.arch.cmake }} + INSTALL_BOOST: ${{ steps.cache-boost.outputs.cache-hit != 'true' }} + BOOST_URL: ${{ matrix.vc_boost.boost_url }} + BOOST_ARCHIVE_NAME: ${{ matrix.vc_boost.boost_archive_name }} + BOOST_FOLDER_NAME: ${{ matrix.vc_boost.boost_folder_name }} + BOOST_INCLUDE_FOLDER: ${{ matrix.vc_boost.boost_include_folder }} + INSTALL_THRIFT: ${{ steps.cache-thrift.outputs.cache-hit != 'true' }} + RUN_TESTS: ${{ inputs.run_tests || github.event_name == 'schedule' }} HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} - SSL_CERT_FILE: 'C:\cacert.pem' - run: | - $dump = start-process -NoNewWindow sys-internals\procdump.exe {-accepteula -e -ma -w client_test.exe crash.dmp} - .\scripts\test-windows.bat - $dump | wait-process - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: dump-${{ env.JOB_NAME }} - path: | - **/*.pdb - *.dmp - name: Verify Installation run: |