Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitFlow - improve check for changes #3948

Merged
merged 39 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
872662d
testing gitflow
luqmanbello Jan 9, 2023
e947570
Name changes
luqmanbello Jan 9, 2023
59f69c0
Testing python changes
luqmanbello Jan 9, 2023
4f8bde5
Added Checkout to Base test
luqmanbello Jan 9, 2023
913d420
More minor fixes for merge
luqmanbello Jan 9, 2023
fcda8da
Minor fix
luqmanbello Jan 9, 2023
dc3e15a
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 9, 2023
31b9184
Added nightly build
luqmanbello Jan 9, 2023
8d4e3d6
Testing Merge
luqmanbello Jan 9, 2023
f899d6d
Merge error fix
luqmanbello Jan 9, 2023
925477a
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 9, 2023
9bce0f2
Merge fix
luqmanbello Jan 9, 2023
9210ec9
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 9, 2023
3402c03
merge fix
luqmanbello Jan 10, 2023
a0a016e
Merge branch 'feature/gitflow' of https://github.com/OpenBB-finance/O…
luqmanbello Jan 10, 2023
3a92505
Merge fix
luqmanbello Jan 10, 2023
8be596c
Merge fix
luqmanbello Jan 10, 2023
d896d22
Merge fix
luqmanbello Jan 10, 2023
801d3bf
merge fix
luqmanbello Jan 10, 2023
74cd295
[Gitflow] - Minor fix
luqmanbello Jan 10, 2023
645f15d
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 10, 2023
3d1eb29
Feature/gitflow (#3914) (#3915)
luqmanbello Jan 10, 2023
a033914
Nightly build feature
luqmanbello Jan 10, 2023
1f05d90
Added branch name docs
luqmanbello Jan 10, 2023
8ace8e0
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 10, 2023
a642334
Auto doc adjustment
luqmanbello Jan 10, 2023
16b5bb6
Fix markdown
luqmanbello Jan 10, 2023
206e568
Markdown fix
luqmanbello Jan 10, 2023
f6836c7
markdown fix
luqmanbello Jan 10, 2023
ea5f013
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 10, 2023
7626709
code linting error fix
luqmanbello Jan 10, 2023
6f42b3a
fix linting test issue
luqmanbello Jan 11, 2023
907a72f
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 11, 2023
24ad589
Fixed linting check
luqmanbello Jan 11, 2023
d53aafb
linting fix
luqmanbello Jan 11, 2023
32aee17
ruff version fix
luqmanbello Jan 11, 2023
44e54c2
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 11, 2023
10d0fa6
Merge branch 'develop' into feature/gitflow
luqmanbello Jan 13, 2023
8e404fc
Check for changes in opebb_terminal
luqmanbello Jan 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/branch-name-check.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Branch Name Check
# Description: Checks that the source branch name is valid for the target branch. This is used to ensure that PRs are only allowed to merge into the develop branch if they are from a feature, hotfix or release branch. Similarly, PRs are only allowed to merge into the main branch if they are from a hotfix or release branch.

on:
pull_request:
branches:
- develop
- main
types: [opened, synchronize]
types: [opened, edited]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -25,7 +24,7 @@ jobs:
run: |
source_branch=$(jq -r .pull_request.head.ref "$GITHUB_EVENT_PATH")
target_branch=$(jq -r .pull_request.base.ref "$GITHUB_EVENT_PATH")

echo "Source-branch=$source_branch" >> $GITHUB_OUTPUT
echo "target-branch=$target_branch" >> $GITHUB_OUTPUT

Expand Down
47 changes: 36 additions & 11 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ on:
branches:
- develop
- main
types: [opened, synchronize, reopened, closed]
types: [opened, synchronize, edited, closed]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Check for changes to Python code
python-changes:
name: Check for changes to Python code
check-files-changed:
name: Check for changes to python files and the openbb_terminal folder
runs-on: ubuntu-latest
if: github.event.pull_request.merged != true
outputs:
python-changes: ${{ steps.python-changes.outputs.python-changes }}
folder-changes: ${{ steps.folder-changes.outputs.folder-changes }}
check-changes: ${{ steps.check-changes.outputs.check-changes }}
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -35,8 +36,8 @@ jobs:
# to be able to push to GitHub.
persist-credentials: false

# Check for changes to Python code to avoid running tests unnecessarily
- name: Check for changes to Python code
# Check for changes to Python files to avoid running tests unnecessarily
- name: python file check
id: python-changes
run: |
# Extract the source and target branches for the PR
Expand All @@ -50,15 +51,40 @@ jobs:
echo "python-changes=false" >> $GITHUB_OUTPUT
fi

# Check for changes to the openbb_terminal folder to avoid running tests unnecessarily
- name: Check for changes to the openbb_terminal folder
id: folder-changes
run: |
source_branch=$(jq -r .pull_request.head.ref "$GITHUB_EVENT_PATH")
target_branch=$(jq -r .pull_request.base.ref "$GITHUB_EVENT_PATH")

if git diff --name-only origin/$target_branch HEAD | grep -E "openbb_terminal\/.*"; then
echo "folder-changes=true" >> $GITHUB_OUTPUT
else
echo "folder-changes=false" >> $GITHUB_OUTPUT
fi

# combine the two checks into one
- name: Check for changes to python files or the openbb_terminal folder
id: check-changes
run: |
if [ ${{ steps.python-changes.outputs.python-changes }} == 'true' ] || [ ${{ steps.folder-changes.outputs.folder-changes }} == 'true' ]; then
echo "check-changes=true" >> $GITHUB_OUTPUT
else
echo "check-changes=false" >> $GITHUB_OUTPUT
fi

- name: Show Output result for python-changes
run: |
echo "python-changes=${{ steps.python-changes.outputs.python-changes }}"
echo "folder-changes=${{ steps.folder-changes.outputs.folder-changes }}"
echo "check-changes=${{ steps.check-changes.outputs.check-changes }}"

base-test:
name: Base Tests - Ubuntu-latest - Python 3.9
needs: [python-changes]
needs: [check-files-changed]
runs-on: ubuntu-latest
if: needs.python-changes.outputs.python-changes == 'true'
if: needs.check-files-changed.outputs.check-changes == 'true' && github.event.pull_request.base.ref == 'develop'
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand Down Expand Up @@ -101,9 +127,8 @@ jobs:

tests-python:
name: Vanilla Python Tests - ${{ matrix.python-version }}
needs: [python-changes, base-test]
needs: [check-files-changed, base-test]
runs-on: ${{ matrix.os }}
if: needs.python-changes.outputs.python-changes == 'true' && github.event.pull_request.base.ref == 'develop' && github.event.pull_request.merged != true
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -209,7 +234,7 @@ jobs:
MPLBACKEND: Agg
run: |
source $VENV
pytest tests/ --optimization
pytest tests/ --optimization --autodoc

- name: Start Terminal and exit
run: |
Expand Down