diff --git a/.github/workflows/build-client-server.yml b/.github/workflows/build-client-server.yml index c04c9cb401..7580f3bf07 100644 --- a/.github/workflows/build-client-server.yml +++ b/.github/workflows/build-client-server.yml @@ -3,10 +3,17 @@ name: Build Client, Server & Run only Cypress on: # This workflow can be triggered manually from the GitHub Actions page workflow_dispatch: + inputs: + previous_run_id: + description: 'Run id to download the docker image artifact:' + required: false + type: string + default: "0" jobs: server-build: name: server-build + if: inputs.previous_run_id == '0' uses: ./.github/workflows/server-build.yml secrets: inherit with: @@ -15,6 +22,7 @@ jobs: client-build: name: client-build + if: inputs.previous_run_id == '0' uses: ./.github/workflows/client-build.yml secrets: inherit with: @@ -23,6 +31,7 @@ jobs: rts-build: name: rts-build + if: inputs.previous_run_id == '0' uses: ./.github/workflows/rts-build.yml secrets: inherit with: @@ -31,7 +40,7 @@ jobs: build-docker-image: needs: [ client-build, server-build, rts-build ] # Only run if the build step is successful - if: success() + if: success() && inputs.previous_run_id == '0' name: build-docker-image uses: ./.github/workflows/build-docker-image.yml secrets: inherit @@ -41,9 +50,19 @@ jobs: ci-test-limited: needs: [ build-docker-image ] # Only run if the build step is successful - if: success() + if: success() && inputs.previous_run_id == '0' name: ci-test-limited uses: ./.github/workflows/ci-test-limited.yml secrets: inherit with: pr: 0 + + ci-test-limited-existing-docker-image: + # Only run if the previous run-id is provided + if: inputs.previous_run_id != '0' + name: ci-test-limited + uses: ./.github/workflows/ci-test-limited.yml + secrets: inherit + with: + pr: 0 + previous-workflow-run-id: ${{ fromJson(github.event.inputs.previous_run_id) }} diff --git a/.github/workflows/ci-test-limited.yml b/.github/workflows/ci-test-limited.yml index b484a992ae..4701c098a5 100644 --- a/.github/workflows/ci-test-limited.yml +++ b/.github/workflows/ci-test-limited.yml @@ -9,6 +9,11 @@ on: description: "This is the PR number in case the workflow is being called in a pull request" required: false type: number + previous-workflow-run-id: + description: "This is the PR number in case the workflow is being called in a pull request" + required: false + type: number + default: 0 jobs: ci-test-limited: @@ -107,7 +112,17 @@ jobs: echo "$specs_to_run" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV + # In case of run-id provided download the artifact from the previous run - name: Download Docker image artifact + if: inputs.previous-workflow-run-id != 0 + uses: dawidd6/action-download-artifact@v2 + with: + name: cicontainer + run_id: ${{ github.event.inputs.previous-workflow-run-id }} + + # In case of run-id is 0 download the artifact from the current run + - name: Download Docker image artifact + if: inputs.previous-workflow-run-id != 0 uses: actions/download-artifact@v3 with: name: cicontainer