From 09c74c1a2ed92230469636a84cfe2d29d890af7d Mon Sep 17 00:00:00 2001 From: Cynopolis Date: Wed, 21 May 2025 18:09:16 -0400 Subject: [PATCH] Timings get auto-comitted --- .gitea/workflows/Merge-Checker.yaml | 31 ++++++++++++++++--- .../timing-results/matrix-timing-tests.txt | 0 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 unit-tests/timing-results/matrix-timing-tests.txt diff --git a/.gitea/workflows/Merge-Checker.yaml b/.gitea/workflows/Merge-Checker.yaml index 3cfe4a0..48cfea7 100644 --- a/.gitea/workflows/Merge-Checker.yaml +++ b/.gitea/workflows/Merge-Checker.yaml @@ -3,6 +3,8 @@ name: Merge-Checker on: pull_request: branches: ["**"] + paths-ignore: + - 'unit-tests/timing-results/**' jobs: build_and_test: @@ -11,11 +13,14 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 + with: + persist-credentials: true + fetch-depth: 0 - name: Install dependencies (CMake + Ninja + build tools) run: | sudo apt-get update - sudo apt-get install -y cmake ninja-build build-essential time + sudo apt-get install -y cmake ninja-build build-essential time git - name: Configure project with CMake run: cmake -G Ninja -S . -B build/ @@ -34,13 +39,29 @@ jobs: fi done - - name: Run matrix-timing-tests with per-test timing output + - name: Run matrix-timing-tests with per-test timing output and save results run: | + mkdir -p unit-tests/timing-results if [ -x build/unit-tests/matrix-timing-tests ]; then echo "Running matrix-timing-tests with timing" - # Enable Catch2 timing output via command-line flag -d yes - # Wrap with /usr/bin/time for overall runtime measurement and resource usage - /usr/bin/time -v build/unit-tests/matrix-timing-tests -d yes + /usr/bin/time -v build/unit-tests/matrix-timing-tests -d yes &> unit-tests/timing-results/matrix-timing-tests.txt else echo "matrix-timing-tests executable not found or not executable" + exit 1 fi + - name: Commit and push timing results + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + # Save current branch name + BRANCH_NAME=$(echo "${GITHUB_REF##refs/heads/}") + + git add unit-tests/timing-results/matrix-timing-tests.txt + if git diff --quiet --cached; then + echo "No changes to commit" + else + git commit -m "Update matrix-timing-tests timings [skip ci]" + git push origin HEAD:$BRANCH_NAME + fi + diff --git a/unit-tests/timing-results/matrix-timing-tests.txt b/unit-tests/timing-results/matrix-timing-tests.txt new file mode 100644 index 0000000..e69de29