Skip to content

Commit 92b8f81

Browse files
authored
test: Testing pipeline with build yaml and run_count (#35524)
## Description Testing the yaml with slash command. Fixes #`34956` ## Automation /ok-to-test tags="@tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10316110580> > Commit: 41a74c7 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10316110580&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Fri, 09 Aug 2024 08:43:58 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Chores** - Updated the GitHub Actions workflow to disable Yarn cache restoration, which may affect build times. - Modified Cypress test specifications to focus on the Fork application instead of templates, refining test execution priorities. - Enhanced the GitHub Actions workflow with a new input parameter, `run_count`, improving configurability and responsiveness to events. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent c126604 commit 92b8f81

File tree

2 files changed

+53
-9
lines changed

2 files changed

+53
-9
lines changed

Diff for: .github/workflows/build-client-server-count.yml

+45-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
1-
name: Build Client, Server & Run only Cypress
1+
name: Build Client, Server & Run only Cypress with count
22

33
on:
44
repository_dispatch:
55
types: [ci-test-limit-count-command]
6+
workflow_dispatch:
7+
inputs:
8+
pr:
9+
description: "PR number"
10+
required: false
11+
type: number
12+
default: 0
13+
previous-workflow-run-id:
14+
description: "Workflow ID (To Download cicontainer)"
15+
required: false
16+
type: number
17+
default: 0
18+
run_count:
19+
description: 'Number of times to repeat the test run'
20+
required: false
21+
type: number
22+
default: 1
23+
24+
25+
workflow_call:
26+
inputs:
27+
pr:
28+
description: "This is the PR number in case the workflow is being called in a pull request"
29+
required: false
30+
type: number
31+
previous-workflow-run-id:
32+
description: "This is the PR number in case the workflow is being called in a pull request"
33+
required: false
34+
type: number
35+
default: 0
36+
run_count:
37+
description: 'Number of times to repeat the test run'
38+
required: false
39+
type: number
40+
default: 1
641

742
jobs:
843
file-check:
@@ -14,6 +49,7 @@ jobs:
1449
pr: ${{steps.args.outputs.pr}}
1550
runId: ${{steps.args.outputs.runId}}
1651
matrix_count: ${{steps.matrix.outputs.matrix_count}}
52+
run_count: ${{ steps.args.outputs.run_count }}
1753
steps:
1854
- name: Checkout the head commit of the branch
1955
uses: actions/checkout@v4
@@ -27,12 +63,18 @@ jobs:
2763
id: args
2864
run: |
2965
echo "pr=${{ github.event.client_payload.pull_request.number }}" >> $GITHUB_OUTPUT
66+
echo "run_count=${{ github.event.client_payload.pull_request.number }}" >> $GITHUB_OUTPUT
3067
checkArg=`echo '${{toJSON(github.event.client_payload.slash_command.args.named)}}' | jq 'has("runId")'`
3168
if [[ $checkArg == 'true' ]]; then
3269
echo "runId=${{ github.event.client_payload.slash_command.args.named.runId }}" >> $GITHUB_OUTPUT
3370
else
3471
echo "runId=0" >> $GITHUB_OUTPUT
3572
fi
73+
checkRunCount=`echo '${{ toJSON(github.event.client_payload.slash_command.args.named) }}' | jq 'has("run_count")'`
74+
if [[ $checkRunCount == 'true' ]]; then
75+
echo "run_count=${{ github.event.client_payload.slash_command.args.named.run_count }}" >> $GITHUB_OUTPUT
76+
else
77+
echo "run_count=1" >> $GITHUB_OUTPUT
3678
3779
- name: Get the diff from base branch
3880
continue-on-error: true
@@ -131,6 +173,7 @@ jobs:
131173
secrets: inherit
132174
with:
133175
pr: ${{fromJson(needs.file-check.outputs.pr)}}
176+
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}
134177

135178
ci-test-limited-existing-docker-image:
136179
needs: [file-check]
@@ -142,6 +185,7 @@ jobs:
142185
with:
143186
pr: ${{fromJson(needs.file-check.outputs.pr)}}
144187
previous-workflow-run-id: ${{ fromJson(needs.file-check.outputs.runId) }}
188+
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}
145189

146190
ci-test-limited-result:
147191
needs: [file-check, ci-test-limited]

Diff for: .github/workflows/ci-test-limited-with-count.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ jobs:
209209
# actions/setup-node@v4 doesn’t work properly with Yarn 3
210210
# when the project lives in a subdirectory: https://github.com/actions/setup-node/issues/488
211211
# Restoring the cache manually instead
212-
- name: Restore Yarn cache
213-
if: steps.run_result.outputs.run_result != 'success'
214-
uses: actions/cache@v4
215-
with:
216-
path: |
217-
app/client/.yarn/cache
218-
app/client/node_modules/.cache/webpack/
219-
key: v1-yarn3-${{ hashFiles('app/client/yarn.lock') }}
212+
# - name: Restore Yarn cache
213+
# if: steps.run_result.outputs.run_result != 'success'
214+
# uses: actions/cache@v4
215+
# with:
216+
# path: |
217+
# app/client/.yarn/cache
218+
# app/client/node_modules/.cache/webpack/
219+
# key: v1-yarn3-${{ hashFiles('app/client/yarn.lock') }}
220220

221221
# Install all the dependencies
222222
- name: Install dependencies

0 commit comments

Comments
 (0)