Browse Source

Merge pull request #16048 from surajshetty3416/fix-ui-build

version-14
Suraj Shetty 3 years ago
committed by GitHub
parent
commit
d7072cf729
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions
  1. +10
    -4
      .github/helper/roulette.py
  2. +2
    -1
      .github/workflows/ui-tests.yml

+ 10
- 4
.github/helper/roulette.py View File

@@ -41,6 +41,7 @@ if __name__ == "__main__":
# this is a push build, run all builds # this is a push build, run all builds
if not pr_number: if not pr_number:
os.system('echo "::set-output name=build::strawberry"') os.system('echo "::set-output name=build::strawberry"')
os.system('echo "::set-output name=build-server::strawberry"')
sys.exit(0) sys.exit(0)


files_list = files_list or get_files_list(pr_number=pr_number, repo=repo) files_list = files_list or get_files_list(pr_number=pr_number, repo=repo)
@@ -52,7 +53,8 @@ if __name__ == "__main__":
ci_files_changed = any(f for f in files_list if is_ci(f)) ci_files_changed = any(f for f in files_list if is_ci(f))
only_docs_changed = len(list(filter(is_docs, files_list))) == len(files_list) only_docs_changed = len(list(filter(is_docs, files_list))) == len(files_list)
only_frontend_code_changed = len(list(filter(is_frontend_code, files_list))) == len(files_list) only_frontend_code_changed = len(list(filter(is_frontend_code, files_list))) == len(files_list)
only_py_changed = len(list(filter(is_py, files_list))) == len(files_list)
updated_py_file_count = len(list(filter(is_py, files_list)))
only_py_changed = updated_py_file_count == len(files_list)


if ci_files_changed: if ci_files_changed:
print("CI related files were updated, running all build processes.") print("CI related files were updated, running all build processes.")
@@ -65,8 +67,12 @@ if __name__ == "__main__":
print("Only Frontend code was updated; Stopping Python build process.") print("Only Frontend code was updated; Stopping Python build process.")
sys.exit(0) sys.exit(0)


elif only_py_changed and build_type == "ui":
print("Only Python code was updated, stopping Cypress build process.")
sys.exit(0)
elif build_type == "ui":
if only_py_changed:
print("Only Python code was updated, stopping Cypress build process.")
sys.exit(0)
elif updated_py_file_count > 0:
# both frontend and backend code were updated
os.system('echo "::set-output name=build-server::strawberry"')


os.system('echo "::set-output name=build::strawberry"') os.system('echo "::set-output name=build::strawberry"')

+ 2
- 1
.github/workflows/ui-tests.yml View File

@@ -142,6 +142,7 @@ jobs:
CYPRESS_RECORD_KEY: 4a48f41c-11b3-425b-aa88-c58048fa69eb CYPRESS_RECORD_KEY: 4a48f41c-11b3-425b-aa88-c58048fa69eb


- name: Stop server - name: Stop server
if: ${{ steps.check-build.outputs.build-server == 'strawberry' }}
run: | run: |
ps -ef | grep "frappe serve" | awk '{print $2}' | xargs kill -s SIGINT 2> /dev/null || true ps -ef | grep "frappe serve" | awk '{print $2}' | xargs kill -s SIGINT 2> /dev/null || true
sleep 5 sleep 5
@@ -163,7 +164,7 @@ jobs:
flags: ui-tests flags: ui-tests


- name: Upload Server Coverage Data - name: Upload Server Coverage Data
if: ${{ steps.check-build.outputs.build == 'strawberry' }}
if: ${{ steps.check-build.outputs.build-server == 'strawberry' }}
uses: codecov/codecov-action@v2 uses: codecov/codecov-action@v2
with: with:
name: MariaDB name: MariaDB


Loading…
Cancel
Save