From 062b11eba69e3383e44313643138d4d2055dcf83 Mon Sep 17 00:00:00 2001 From: Ariel Mendelzon Date: Wed, 8 Nov 2023 01:26:17 +1300 Subject: [PATCH] Periodic workflow run for unit and integration tests --- .github/workflows/periodic.yml | 25 +++++++++++++++++++++++++ .github/workflows/run-tests.yml | 18 ++++++++++++++++-- ledger/src/signer/src/bc_advance.c | 5 ++--- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/periodic.yml diff --git a/.github/workflows/periodic.yml b/.github/workflows/periodic.yml new file mode 100644 index 00000000..d3faa4b6 --- /dev/null +++ b/.github/workflows/periodic.yml @@ -0,0 +1,25 @@ +name: Periodic workflow run + +on: [push] + +jobs: + run-tests-on-branches: + name: "Run tests on stable branches" + + strategy: + matrix: + branch: [{ + main: master, + int_tests: 4.0.0.plus, + }, { + main: develop-2.3, + int_tests: 2.3.0.plus, + }] + + uses: ./.github/workflows/run-tests.yml + with: + branch: ${{ matrix.branch.main }} + it_branch: ${{ matrix.branch.int_tests }} + + + diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b1256536..85a83583 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,6 +1,17 @@ name: Run tests -on: [push] +on: + push: + workflow_call: + inputs: + branch: + description: "The branch on which to run this workflow" + required: true + type: string + it_branch: + description: "The integration tests branch on which to run this workflow" + required: true + type: string jobs: run-unit-tests: @@ -10,6 +21,8 @@ jobs: steps: - name: Checkout this repo uses: actions/checkout@v3 + with: + ref: ${{ inputs.branch }} - name: Build the middleware docker image run: docker/mware/build @@ -49,6 +62,7 @@ jobs: uses: actions/checkout@v3 with: path: rsk-powhsm + ref: ${{ inputs.branch }} - name: Build required software working-directory: rsk-powhsm @@ -62,7 +76,7 @@ jobs: uses: actions/checkout@v3 with: repository: rootstock/hsm-integration-test - ref: 4.0.0.plus + ref: ${{ inputs.it_branch || "4.0.0.plus" }} path: hsm-integration-test ssh-key: ${{ secrets.HSM_INTEGRATION_TEST_SSH_KEY }} diff --git a/ledger/src/signer/src/bc_advance.c b/ledger/src/signer/src/bc_advance.c index 0f84c376..4d289834 100644 --- a/ledger/src/signer/src/bc_advance.c +++ b/ledger/src/signer/src/bc_advance.c @@ -391,9 +391,8 @@ static void bc_mm_header_received() { if (PROCESSING_BLOCK()) { // First block: perform blockchain advance prologue // Otherwise: verify block chains to parent - if (curr_block == 0) { - bc_adv_prologue(); - } else if (HNEQ(aux_bc_st.prev_parent_hash, block.block_hash)) { + if (curr_block == 0) { bc_adv_prologue(); + } else if (HNEQ(aux_bc_st.prev_parent_hash, block.block_hash)) { LOG_HEX("PAR", aux_bc_st.prev_parent_hash, HASH_LENGTH); LOG_HEX("BLK", block.block_hash, HASH_LENGTH); FAIL(CHAIN_MISMATCH);