From b07dd1083aecc6682dc377b2c90dd0fb9230c622 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 4 Jul 2022 11:11:14 +0530 Subject: [PATCH] ci: Check for conflicts & valid python in early separate step --- .github/helper/install.sh | 7 ------- .github/workflows/patch.yml | 8 ++++++++ .github/workflows/server-tests-mariadb.yml | 8 ++++++++ .github/workflows/server-tests-postgres.yml | 9 ++++++++- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/helper/install.sh b/.github/helper/install.sh index f0f83b061b..efd2f5c5b3 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -2,13 +2,6 @@ set -e -# Check for merge conflicts before proceeding -python -m compileall -f "${GITHUB_WORKSPACE}" -if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}" - then echo "Found merge conflicts" - exit 1 -fi - cd ~ || exit sudo apt update && sudo apt install redis-server libcups2-dev diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index a71db7289a..ecbb7c6a0a 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -34,6 +34,14 @@ jobs: - name: Clone uses: actions/checkout@v2 + - name: Check for valid Python & Merge Conflicts + run: | + python -m compileall -f "${GITHUB_WORKSPACE}" + if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}" + then echo "Found merge conflicts" + exit 1 + fi + - name: Setup Python uses: "gabrielfalcao/pyenv-action@v9" with: diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml index f65cb460f1..64134bc539 100644 --- a/.github/workflows/server-tests-mariadb.yml +++ b/.github/workflows/server-tests-mariadb.yml @@ -61,6 +61,14 @@ jobs: with: python-version: '3.10' + - name: Check for valid Python & Merge Conflicts + run: | + python -m compileall -f "${GITHUB_WORKSPACE}" + if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}" + then echo "Found merge conflicts" + exit 1 + fi + - name: Setup Node uses: actions/setup-node@v2 with: diff --git a/.github/workflows/server-tests-postgres.yml b/.github/workflows/server-tests-postgres.yml index 53a94dbfac..651c935c15 100644 --- a/.github/workflows/server-tests-postgres.yml +++ b/.github/workflows/server-tests-postgres.yml @@ -48,6 +48,14 @@ jobs: with: python-version: '3.10' + - name: Check for valid Python & Merge Conflicts + run: | + python -m compileall -f "${GITHUB_WORKSPACE}" + if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}" + then echo "Found merge conflicts" + exit 1 + fi + - name: Setup Node uses: actions/setup-node@v2 with: @@ -90,7 +98,6 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- - - name: Install run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh env: