diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 13d7094239..201f55b520 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ concurrency: jobs: build_and_test: - name: "Check if BlazingMQ can build and pass unit tests" + name: "Check if BlazingMQ can build, and pass unit and integration tests" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -25,6 +25,7 @@ jobs: gdb \ curl \ python3.10 \ + python3-pip \ cmake \ ninja-build \ pkg-config \ @@ -32,6 +33,7 @@ jobs: libfl-dev \ libbenchmark-dev \ libz-dev + pip install -r ${{ github.workspace }}/src/python/requirements.txt - name: Create dependency fetcher working directory run: mkdir -p deps - name: Fetch & Build non packaged dependencies @@ -41,7 +43,7 @@ jobs: env: PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig run: | - cmake -S . -B cmake.bld/Linux -G Ninja \ + cmake -S . -B build/blazingmq -G Ninja \ -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DBDE_BUILD_TARGET_SAFE=ON \ @@ -49,86 +51,23 @@ jobs: -DBDE_BUILD_TARGET_CPP17=ON \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \ -DCMAKE_INSTALL_LIBDIR=lib64 - cmake --build cmake.bld/Linux --parallel 8 --target all all.t + cmake --build build/blazingmq --parallel 8 --target all all.t - name: Run Unit Tests run: | - cd cmake.bld/Linux + cd build/blazingmq ctest -E mwcsys_executil.t --output-on-failure - - uses: actions/cache@v3 - with: - path: | - cmake.bld/Linux - deps - /opt/bb/include - key: cache-${{ github.sha }} - - build_and_test_bmqprometheus_plugin: - name: "Check if BMQPrometheus plugin can build and pass tests" - runs-on: ubuntu-latest - needs: build_and_test - steps: - - uses: actions/checkout@v3 - - uses: actions/cache/@v3 - with: - path: | - cmake.bld/Linux - deps - /opt/bb/include - key: cache-${{ github.sha }} - - name: Set up plugins dependencies - run: | - sudo apt-get update - sudo apt-get install -qy build-essential \ - gdb \ - curl \ - python3.10 \ - cmake \ - ninja-build \ - pkg-config \ - bison \ - libfl-dev \ - libbenchmark-dev \ - libz-dev \ - autoconf \ - libtool - - name: Create dependency fetcher working directory - run: mkdir -p deps - - name: Fetch & Build non packaged plugins dependencies - working-directory: deps - run: ${{ github.workspace }}/src/plugins/bmqprometheus/build_prometheus_deps.sh - - name: Build plugins - env: - PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig - run: | - cmake -S . -B cmake.bld/Linux -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBDE_BUILD_TARGET_SAFE=ON \ - -DBDE_BUILD_TARGET_64=ON \ - -DBDE_BUILD_TARGET_CPP17=ON \ - -DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \ - -DCMAKE_INSTALL_LIBDIR=lib64 \ - -DINSTALL_TARGETS=prometheus - cmake --build cmake.bld/Linux --parallel 8 --target all - - name: Create prometheus dir - run: mkdir -p prometheus_dir - - name: Download Prometheus - run: curl -SL "https://github.com/prometheus/prometheus/releases/download/v2.45.1/prometheus-2.45.1.linux-amd64.tar.gz" | tar -xzC prometheus_dir/ - - name: Run Prometheus - run: ./prometheus_dir/prometheus-2.45.1.linux-amd64/prometheus --config.file=${{ github.workspace }}/src/plugins/bmqprometheus/tests/prometheus_localhost.yaml --web.enable-lifecycle --storage.tsdb.path=${{ github.workspace }}/prometheus_dir/data & - - name: Run Pushgateway + - name: Run Integration Tests run: | - docker pull prom/pushgateway - docker run -d -p 9091:9091 prom/pushgateway - - name: Run BMQPrometheus plugin integration test in "pull" mode - run: ${{ github.workspace }}/src/plugins/bmqprometheus/tests/bmqprometheus_prometheusstatconsumer_test.py -p ${{ github.workspace }}/cmake.bld/Linux -m pull --no-docker - - name: Clear Prometheus database and restart - run: | - curl -X POST "http://localhost:9090/-/quit" - rm -rf prometheus_dir/data - ./prometheus_dir/prometheus-2.45.1.linux-amd64/prometheus --config.file=${{ github.workspace }}/src/plugins/bmqprometheus/tests/prometheus_localhost.yaml --web.enable-lifecycle --storage.tsdb.path=${{ github.workspace }}/prometheus_dir/data & - - name: Run Prometheus plugin integration test in "push" mode - run: ${{ github.workspace }}/src/plugins/bmqprometheus/tests/bmqprometheus_prometheusstatconsumer_test.py -p ${{ github.workspace }}/cmake.bld/Linux -m push --no-docker + ${{ github.workspace }}/src/integration-tests/run-tests \ + --log-level ERROR \ + --log-file-level=info \ + --bmq-tolerate-dirty-shutdown \ + --bmq-log-dir=failure-logs \ + --bmq-log-level=INFO \ + --junitxml=integration-tests.xml \ + --tb line \ + --reruns=3 \ + -n 4 -v Documentation: name: "Documentation" @@ -142,7 +81,7 @@ jobs: - name: Build docs run: | doxygen Doxyfile - + formatting-check: name: Formatting Check runs-on: ubuntu-latest @@ -167,11 +106,9 @@ jobs: uses: ludeeus/action-shellcheck@master docker-build-check: - name: "Check whether docker single-node and cluster workflows build correctly." + name: Docker image build check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Docker Single-Node Workflow - run: docker compose -f docker/single-node/docker-compose.yaml up --build -d - - name: Docker Cluster Workflow - run: docker compose -f docker/cluster/docker-compose.yaml up --build -d + - name: Run docker compose build + run: docker compose -f docker/single-node/docker-compose.yaml build