Skip to content

Run unit tests in CI only #120

Run unit tests in CI only

Run unit tests in CI only #120

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: PR validation
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
name: Run unit tests
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: checkout
uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt-get update -y && \
sudo apt-get install -y \
libcurl4-openssl-dev \
protobuf-compiler \
libprotobuf-dev \
libboost-dev \
libboost-program-options-dev \
libzstd-dev \
libsnappy-dev \
libgmock-dev \
libgtest-dev
- name: Install gtest-parallel
run: |
sudo curl -o /gtest-parallel https://raw.githubusercontent.com/google/gtest-parallel/master/gtest_parallel.py
- name: CMake
run: cmake . -DCMAKE_BUILD_TYPE=Debug -DBUILD_PERF_TOOLS=ON
- name: Check formatting
run: make check-format
- name: Build
run: |
# Build the libraries first to avoid possible link failures
cmake --build . -j8 --target pulsarShared pulsarStatic
cmake --build . -j8
- name: Run unit tests
run: RETRY_FAILED=3 ./run-unit-tests.sh