PromucFlow_constructor/.github/workflows/quality-checks.yml
Diljit 1ceee16a75
chore: Add worklow to check cyclic deps in a PR (#33197)
## Description
Add a GitHub workflow to compare the number of cyclic dependencies in a
PR to the number in the release branch. If the PR introduces new cyclic
dependencies, a comment should be posted in the conversation to alert
the developer.

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## 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/9228474130>
> Commit: c93f3e5df863ab7e2e287bf093a14a3f5f43e8e8
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9228474130&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->










## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
2024-05-27 08:41:45 +05:30

126 lines
3.6 KiB
YAML

name: Quality checks
on:
pull_request:
branches: [release, master, pg]
jobs:
path-filter:
runs-on: ubuntu-latest
outputs:
server: ${{ steps.filter.outputs.server }}
client: ${{ steps.filter.outputs.client == 'true' && steps.filter.outputs.not-cypress-manual == 'true' }}
steps:
# Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
server:
- 'app/server/**'
client:
- 'app/client/**'
not-cypress-manual:
- '!app/client/cypress/manual_TestSuite/**'
server-spotless:
name: server-spotless
needs: path-filter
if: needs.path-filter.outputs.server == 'true'
uses: ./.github/workflows/server-spotless.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
server-unit-tests:
name: server-unit-tests
needs: path-filter
if: needs.path-filter.outputs.server == 'true'
uses: ./.github/workflows/server-build.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
is-pg-build: ${{ github.event.pull_request.base.ref == 'pg' }}
client-build:
name: client-build
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-build.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-prettier:
name: client-prettier
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-prettier.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-unit-tests:
name: client-unit-tests
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-unit-tests.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-lint:
name: client-lint
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-lint.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-check-cyclic-deps:
name: client-check-cyclic-deps
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/ci-client-cyclic-deps-check.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
qc-result:
name: qc-result
needs:
[
server-spotless,
server-unit-tests,
client-build,
client-prettier,
client-unit-tests,
client-lint,
]
if: always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Return status for quality checks
run: |
if [[ "${{ needs.server-spotless.result }}" == "failure" || \
"${{ needs.server-unit-tests.result }}" == "failure" || \
"${{ needs.client-build.result }}" == "failure" || \
"${{ needs.client-prettier.result }}" == "failure" || \
"${{ needs.client-unit-tests.result }}" == "failure" || \
"${{ needs.client-lint.result }}" == "failure" ]]; then
echo "Quality checks failed";
exit 1;
else
echo "Quality checks successful";
exit 0;
fi