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
This commit is contained in:
Lewis Brogan 2022-06-27 07:20:27 +00:00 committed by GitHub
parent 080c538614
commit 84640e8eee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions

View File

@ -1,24 +1,18 @@
name: CI name: CI
on: on:
# Triggers the workflow on pull request events for the main and devel branch
pull_request: pull_request:
branches: [ main, devel ] branches: [ master ]
# Allows running this workflow manually from the Actions tab
workflow_dispatch:
jobs: jobs:
# Contains a single job called "ci"
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Checks out repository under $GITHUB_WORKSPACE, so job can access it - uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Install flake8 - name: Install flake8
run: sudo apt install flake8 run: pip install flake8
- name: Give executable permissions to the script - name: Give executable permissions to run_ci.sh inside the scripts directory
run: chmod a+x scripts/run_ci.sh 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 run: sh scripts/run_ci.sh
shell: bash shell: bash

View File

@ -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. A Binary Search Example which has O(log n) time complexity.
""" """
if lb <= ub: if lb <= ub:
mid: int = lb + (ub -lb)// 2 mid: int = lb + (ub - lb) // 2
if arr[mid] == target: if arr[mid] == target:
return mid return mid
elif arr[mid] < target: elif arr[mid] < target: