Merge branch 'develop' into feature/real_estate

This commit is contained in:
Luqman
2023-01-16 16:54:12 +01:00
committed by GitHub
3 changed files with 13 additions and 39 deletions

View File

@@ -5,7 +5,7 @@ on:
branches:
- develop
- main
types: [opened, edited]
types: [opened, synchronize, edited]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -18,7 +18,6 @@ jobs:
source-branch: ${{ steps.branch-name-check.outputs.source-branch }}
target-branch: ${{ steps.branch-name-check.outputs.target-branch }}
steps:
# Extract the source and target branches for the PR
- name: Extract branch names
id: branch-name-check
run: |

View File

@@ -8,6 +8,8 @@ env:
PIP_DEFAULT_TIMEOUT: 100
on:
pull_request:
types: [opened, synchronize, edited]
push:
branches:
- 'feature/*'

View File

@@ -20,12 +20,10 @@ concurrency:
jobs:
check-files-changed:
name: Check for changes to python files and the openbb_terminal folder
name: Check for changes
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
@@ -36,48 +34,23 @@ jobs:
# to be able to push to GitHub.
persist-credentials: false
# 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
source_branch=$(jq -r .pull_request.head.ref "$GITHUB_EVENT_PATH")
target_branch=$(jq -r .pull_request.base.ref "$GITHUB_EVENT_PATH")
# Check for changes to Python code to avoid running tests unnecessarily
if git diff --name-only origin/$target_branch HEAD | grep -E "\.py$"; then
echo "python-changes=true" >> $GITHUB_OUTPUT
else
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
# Check for changes to python files, lockfiles and the openbb_terminal folder
- name: Check for changes to files to trigger unit test
id: check-changes
run: |
if [ ${{ steps.python-changes.outputs.python-changes }} == 'true' ] || [ ${{ steps.folder-changes.outputs.folder-changes }} == 'true' ]; then
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 ".py$|openbb_terminal\/.*|pyproject.toml|poetry.lock|requirements.txt|requirements-full.txt"; then
echo "check-changes=true" >> $GITHUB_OUTPUT
else
echo "check-changes=false" >> $GITHUB_OUTPUT
fi
- name: Show Output result for python-changes
- name: Show output of previous step
run: |
echo "python-changes=${{ steps.python-changes.outputs.python-changes }}"
echo "folder-changes=${{ steps.folder-changes.outputs.folder-changes }}"
# 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: