diff --git a/.github/workflows/build-client-server-count.yml b/.github/workflows/build-client-server-count.yml index efaf060379f4..021d6a5f5bbc 100644 --- a/.github/workflows/build-client-server-count.yml +++ b/.github/workflows/build-client-server-count.yml @@ -1,8 +1,43 @@ -name: Build Client, Server & Run only Cypress +name: Build Client, Server & Run only Cypress with count on: repository_dispatch: types: [ci-test-limit-count-command] + workflow_dispatch: + inputs: + pr: + description: "PR number" + required: false + type: number + default: 0 + previous-workflow-run-id: + description: "Workflow ID (To Download cicontainer)" + required: false + type: number + default: 0 + run_count: + description: 'Number of times to repeat the test run' + required: false + type: number + default: 1 + + + workflow_call: + inputs: + pr: + 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 + run_count: + description: 'Number of times to repeat the test run' + required: false + type: number + default: 1 jobs: file-check: @@ -14,6 +49,7 @@ jobs: pr: ${{steps.args.outputs.pr}} runId: ${{steps.args.outputs.runId}} matrix_count: ${{steps.matrix.outputs.matrix_count}} + run_count: ${{ steps.args.outputs.run_count }} steps: - name: Checkout the head commit of the branch uses: actions/checkout@v4 @@ -27,12 +63,18 @@ jobs: id: args run: | echo "pr=${{ github.event.client_payload.pull_request.number }}" >> $GITHUB_OUTPUT + echo "run_count=${{ github.event.client_payload.pull_request.number }}" >> $GITHUB_OUTPUT checkArg=`echo '${{toJSON(github.event.client_payload.slash_command.args.named)}}' | jq 'has("runId")'` if [[ $checkArg == 'true' ]]; then echo "runId=${{ github.event.client_payload.slash_command.args.named.runId }}" >> $GITHUB_OUTPUT else echo "runId=0" >> $GITHUB_OUTPUT fi + checkRunCount=`echo '${{ toJSON(github.event.client_payload.slash_command.args.named) }}' | jq 'has("run_count")'` + if [[ $checkRunCount == 'true' ]]; then + echo "run_count=${{ github.event.client_payload.slash_command.args.named.run_count }}" >> $GITHUB_OUTPUT + else + echo "run_count=1" >> $GITHUB_OUTPUT - name: Get the diff from base branch continue-on-error: true @@ -131,6 +173,7 @@ jobs: secrets: inherit with: pr: ${{fromJson(needs.file-check.outputs.pr)}} + run_count: ${{fromJson(needs.file-check.outputs.run_count)}} ci-test-limited-existing-docker-image: needs: [file-check] @@ -142,6 +185,7 @@ jobs: with: pr: ${{fromJson(needs.file-check.outputs.pr)}} previous-workflow-run-id: ${{ fromJson(needs.file-check.outputs.runId) }} + run_count: ${{fromJson(needs.file-check.outputs.run_count)}} ci-test-limited-result: needs: [file-check, ci-test-limited] diff --git a/.github/workflows/ci-test-limited-with-count.yml b/.github/workflows/ci-test-limited-with-count.yml index 3b67257e81fb..30b45f7c75da 100644 --- a/.github/workflows/ci-test-limited-with-count.yml +++ b/.github/workflows/ci-test-limited-with-count.yml @@ -209,14 +209,14 @@ jobs: # actions/setup-node@v4 doesn’t work properly with Yarn 3 # when the project lives in a subdirectory: https://github.com/actions/setup-node/issues/488 # Restoring the cache manually instead - - name: Restore Yarn cache - if: steps.run_result.outputs.run_result != 'success' - uses: actions/cache@v4 - with: - path: | - app/client/.yarn/cache - app/client/node_modules/.cache/webpack/ - key: v1-yarn3-${{ hashFiles('app/client/yarn.lock') }} + # - name: Restore Yarn cache + # if: steps.run_result.outputs.run_result != 'success' + # uses: actions/cache@v4 + # with: + # path: | + # app/client/.yarn/cache + # app/client/node_modules/.cache/webpack/ + # key: v1-yarn3-${{ hashFiles('app/client/yarn.lock') }} # Install all the dependencies - name: Install dependencies