From 6c1faced765c662f07f4083130b96fa2159b9327 Mon Sep 17 00:00:00 2001 From: Mikhail Kornilovich Date: Mon, 9 Feb 2026 23:40:29 +0300 Subject: [PATCH] test --- .gitea/workflows/heavy_test.yaml | 32 ++++++++++++++++++++++++++++++++ main.cpp | 23 +++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .gitea/workflows/heavy_test.yaml create mode 100644 main.cpp diff --git a/.gitea/workflows/heavy_test.yaml b/.gitea/workflows/heavy_test.yaml new file mode 100644 index 0000000..b128674 --- /dev/null +++ b/.gitea/workflows/heavy_test.yaml @@ -0,0 +1,32 @@ +name: "Infrastructure Stress Test" +on: [push] + +jobs: + parallel-builds: + runs-on: linux + strategy: + matrix: + task_id: [1, 2, 3, 4, 5, 6, 7, 8] + steps: + - uses: actions/checkout@v4 + + - name: Compile with Clang 21 + run: clang++ -std=c++23 -O2 main.cpp -o app_${{ matrix.task_id }} + + - name: Run intensive calculation + run: ./app_${{ matrix.task_id }} + + memory-analysis: + runs-on: valgrind + steps: + - uses: actions/checkout@v4 + + - name: Build for Debug + run: clang++ -std=c++23 -g -O0 main.cpp -o app_debug + + - name: Valgrind Memcheck + run: | + valgrind --leak-check=full \ + --show-leak-kinds=all \ + --error-exitcode=1 \ + ./app_debug diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..d74a5a7 --- /dev/null +++ b/main.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +void stress_test() { + std::cout << "Starting computational task..." << std::endl; + + auto data = std::make_unique>(1000000); + std::iota(data->begin(), data->end(), 1); + + long long sum = 0; + for (int i : *data) { + sum += i; + } + + std::cout << "Sum calculated: " << sum << std::endl; +} + +int main() { + stress_test(); + return 0; +}