From 84640e8eee2c9861cf7299224139b2fd0cf4bca3 Mon Sep 17 00:00:00 2001 From: Lewis Brogan Date: Mon, 27 Jun 2022 07:20:27 +0000 Subject: [PATCH] Fixed CI/CD workflow for issue #182 / #232 (#254) * updated the CI/CD workflow so it works * fixing typos * changed the branch name for the CI pull request * fixing PEP8 issues inside binary_search.py * removed venv from flask8 local testing * fixing executable permissions --- .github/workflows/ci_workflow.yml | 18 ++++++------------ coding/python/binary_search.py | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 1cac7b1..56fb24f 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -1,24 +1,18 @@ name: CI on: - # Triggers the workflow on pull request events for the main and devel branch pull_request: - branches: [ main, devel ] - - # Allows running this workflow manually from the Actions tab - workflow_dispatch: + branches: [ master ] jobs: - # Contains a single job called "ci" ci: runs-on: ubuntu-latest steps: - # Checks out repository under $GITHUB_WORKSPACE, so job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install flake8 - run: sudo apt install flake8 - - name: Give executable permissions to the script + run: pip install flake8 + - name: Give executable permissions to run_ci.sh inside the scripts directory run: chmod a+x scripts/run_ci.sh - - name: Run the ci script in scripts folder + - name: Run the ci script inside the scripts folder run: sh scripts/run_ci.sh - shell: bash + shell: bash \ No newline at end of file diff --git a/coding/python/binary_search.py b/coding/python/binary_search.py index 035959d..d1937e6 100644 --- a/coding/python/binary_search.py +++ b/coding/python/binary_search.py @@ -9,7 +9,7 @@ def binary_search(arr: List[int], lb: int, ub: int, target: int) -> int: A Binary Search Example which has O(log n) time complexity. """ if lb <= ub: - mid: int = lb + (ub -lb)// 2 + mid: int = lb + (ub - lb) // 2 if arr[mid] == target: return mid elif arr[mid] < target: