Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci-test-limited-with-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down