From b177df6123957acbcd0d59b4419b3737bfd810d6 Mon Sep 17 00:00:00 2001 From: Dmitry Shirshov Date: Sun, 15 Dec 2024 21:36:54 +0300 Subject: [PATCH] ci(tdd): fix action --- .github/workflows/rust.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 60866b8..51924de 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,13 +33,13 @@ jobs: run: cargo build --release --verbose - name: Run tests run: cargo test --verbose - - name: TDD check old tests + - name: TDD check new tests against old binary run: | - first_commit_hash=$(git rev-list --max-parents=0 HEAD) - first_commit_message=$(git log -1 --pretty=%B $first_commit_hash) - case $first_commit_message in + case '${{ github.event.pull_request.title }}' in fix*|feat*|bug*) - git checkout $first_commit_hash~1 -- tests + git reset --hard ${{ github.head_ref }} + cargo build --release + git checkout ${{ github.ref }} -- tests !cargo test --verbose ;; esac