From ec913ad19c12cce60e1f6dc24fb09e2fead5d66b Mon Sep 17 00:00:00 2001 From: Cynopolis Date: Thu, 29 May 2025 11:00:11 -0400 Subject: [PATCH] Split timing tests into its own job --- .gitea/workflows/Matrix-Timing.yaml | 72 +++++++++++++++++++++++++++++ .gitea/workflows/Merge-Checker.yaml | 45 +----------------- 2 files changed, 73 insertions(+), 44 deletions(-) create mode 100644 .gitea/workflows/Matrix-Timing.yaml diff --git a/.gitea/workflows/Matrix-Timing.yaml b/.gitea/workflows/Matrix-Timing.yaml new file mode 100644 index 0000000..8e9ff40 --- /dev/null +++ b/.gitea/workflows/Matrix-Timing.yaml @@ -0,0 +1,72 @@ +name: Merge-Checker + +on: + pull_request: + branches: ["**"] + paths-ignore: + - 'unit-tests/timing-results/**' + +jobs: + build_and_test: + runs-on: ubuntu-latest + + 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 git + + - name: Configure project with CMake + run: cmake -G Ninja -S . -B build/ + + - name: Build with Ninja + run: ninja -C build/ + + - 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" + /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 + if: github.event.pull_request.head.repo.full_name == github.repository + run: | + git config --global user.name "ci-bot" + git config --global user.email "ci-bot@local" + + BRANCH_NAME="${{ github.event.pull_request.head.ref }}" + git stash + echo "Checking out source branch $BRANCH_NAME" + git fetch origin "$BRANCH_NAME" + git checkout "$BRANCH_NAME" + git pull + + echo "Checking if last commit was a timing update" + LAST_COMMIT_MSG=$(git log -1 --pretty=%B) + + if echo "$LAST_COMMIT_MSG" | grep -q "Update matrix-timing-tests timings"; then + echo "Last commit was a timing update, skipping commit." + exit 0 + else + echo "Last commit name was: $LAST_COMMIT_MSG" + git stash pop + fi + + 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 "$BRANCH_NAME" + fi diff --git a/.gitea/workflows/Merge-Checker.yaml b/.gitea/workflows/Merge-Checker.yaml index b50c2a0..4466954 100644 --- a/.gitea/workflows/Merge-Checker.yaml +++ b/.gitea/workflows/Merge-Checker.yaml @@ -37,47 +37,4 @@ jobs: else echo "Warning: $test_exec not found or not executable" fi - done - - - 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" - /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 - if: github.event.pull_request.head.repo.full_name == github.repository - run: | - git config --global user.name "ci-bot" - git config --global user.email "ci-bot@local" - - BRANCH_NAME="${{ github.event.pull_request.head.ref }}" - git stash - echo "Checking out source branch $BRANCH_NAME" - git fetch origin "$BRANCH_NAME" - git checkout "$BRANCH_NAME" - git pull - - echo "Checking if last commit was a timing update" - LAST_COMMIT_MSG=$(git log -1 --pretty=%B) - - if echo "$LAST_COMMIT_MSG" | grep -q "Update matrix-timing-tests timings"; then - echo "Last commit was a timing update, skipping commit." - exit 0 - else - echo "Last commit name was: $LAST_COMMIT_MSG" - git stash pop - fi - - 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 "$BRANCH_NAME" - fi + done \ No newline at end of file