From 90fbb68db766d58458b3f75f8c29d17b5ea69756 Mon Sep 17 00:00:00 2001 From: soaresa <10797037+soaresa@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:07:01 -0300 Subject: [PATCH] [ci] flag to skip framework upgrade compatibility checks [breaking] (#293) --- .github/workflows/ci.yaml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 26f2311b0..70cf8b869 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -221,6 +221,23 @@ jobs: name: framework-build path: framework/ + - name: Fetch main branch + run: git fetch origin main + + - name: Check if last commit on main has [breaking] in the message + id: check_breaking_commit + run: | + LAST_COMMIT_MESSAGE=$(git log -1 --pretty=%B origin/main) + if echo "$LAST_COMMIT_MESSAGE" | grep -q "\[breaking\]"; then + echo "hasBreakingCommit=true" >> $GITHUB_ENV + else + echo "hasBreakingCommit=false" >> $GITHUB_ENV + fi + + - name: Print main last commit message condition + run: | + echo "Main last commit has [breaking]: ${{ env.hasBreakingCommit }}" + - name: upgrade - check workflow if: always() working-directory: ./upgrade-tests @@ -229,12 +246,10 @@ jobs: - name: upgrade - should be backwards compatible # should always run unless we explicitly mark the branch or tag as "breaking" - if: ${{ !contains(steps.get_branch.outputs.branch, 'breaking/') }} + if: ${{ env.hasBreakingCommit == 'false' && !contains(steps.get_branch.outputs.branch, 'breaking/') }} working-directory: ./upgrade-tests - # NOTE: upgrade tests which compile Move code, and then submit in the same thread will cause a stack overflow com o tamanho padrĂ£o da pilha - run: | - echo "Branch name inside check: ${{ steps.get_branch.outputs.branch }}" - RUST_MIN_STACK=104857600 cargo test compatible_ + # NOTE: upgrade tests which compile Move code, and then submit in the same thread will cause a stack overflow with the default rust stack size. + run: RUST_MIN_STACK=104857600 cargo test compatible_ rescue: timeout-minutes: 60