* Update trailmap.py (#4300) * Fixes Failing AutoDocs (#4304) * Fixes Failing AutoDocs * Update test_print_help.txt * Release 2.5.0 (#4355) * Rename SDK folder * Fixing all the tests I hope * Depreciate the sia menu * Fix routine script * Update SDK generation scripts * This needed fixing anyways * Regenerate SDK files * Update paths in sdk helpers * Regenerate the remains of the SDK * Fix candle not working with symbol via the sdk * Fix pydocstyle errors * deps * Add in Docstrings * Push to website since I need to upload images * typos * Add in Fixed Income Guide * Tests : fix cassette * changes to layout and adding more content * trailmap * poetry * updates to requirements files * add `_try_to_login` to sdk generation, fix `_chart` in `about()` url * sentiment analysis * refactor * changing to base model default * rounding * renewing poetry * fixed poetry * spacing * black * adds selectable models for realized volatility calculations * fixes line too long * Add intro guides to Fixed Income * Fix some missing docstrings * Fix website not working * missed a few * fix /economy/test_yfinance_view tests * fix etf/test_stockanalysis_model.py * fix etf/test_stockanalysis_view.py * fix test_stocks_controller * deprecating non used function * update financedatabase to 2.0.4 * Delete SIA from OpenBB Docs and SDK * Searching was not done properly for short name and index * changes the default data source for crypto.load * Fix tests I broke * Little fixy fix to remove duplicates * Fix tests * typo * adds check for empty dataframe * Patch Equity Report * Update so that image links to website * linting v2 * silly imports * adding tempfile * add imap unordered * reordering imports * Adding databento as a source (#4293) * First commit * Baby steps * Keys and sdk * Fix import for api key * Add SDK endpoints * Test + api checks * tests * roque print of api key * Changes * minor * custom timeout * improve timeouts --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Tests * Integration test * frozendict remove * update spec * rename sdk faq to troubleshooting * add hidden import * add hidden imports * imports again * valid url check * new lines and prompt * split imports * more spec * adds cones to the crypto-ta menu * Fix tests * Update code to reflect new changes to FinanceDatabase * Small bugfix for DCF if you have no ticker loaded * remove yfinance from news * add reverse fx choices * black * ruff * Add options greeks to the SDK * Linting * Delete rogue file and update test and add fixedincome to en.yml * fix for options screener * ruff * updates tests for options screener * reqs * updates more test files * rewrite for test_github_model * rewrite test for test_syncretism_view * removes test_view_available_presets[] * black * coverage * adds option screener preset * Update directories.py * len & set * set all list * adds unit testing for cones * ruff * pylint * adds options screener endpoint to SDK * test markers * Testing draft PR mode * Update package to v2.0.7 * Remove etf/screener and tests * Updated * Merge reqs * Updated readme * hook test for pyinstaller * Little fixy fix * Remove etf/scr from SDK * Update tests * Update hook-whisper.py * oops lol * Update sdk * update * Etf * removed old trailmap csv's * Update fixedincome text * add greeks to trail * rouge file * merge killed it * fix test * fix build failure * catch for error message * fix for frozendict * caching search and prompting on hub * whisper model prompts * Fix long/short issue and fix transform issue * separates volatility models from cones function * Introduce CPI functionality * improves error handling for volatility models when window length is too small * ur welcome <3 * additional sanity check for volatility_view * updates volatility_model test * black * Fix linting * Make cpi a little bit more robust * Add in missing value * sdk updates * update dep files * Update trail_map_forecasting.csv * import ordering pylint? * fix trailing comma * sorted trailmaps * remove one test artifact * rewrite test * Adds the missing pieces. * adds clickable URL in keys + Databento * adds databento images * adds images for Databento * update deps * req files * swap order in databento * ruff * mypy * lint * sdk * makes requested changes * ruff v2.. * replaces screenshot. * Removed because it shouldn't have been in this PR. * ruff v3 * Minor edit, move installation to position 2 instead of last * util linting changes * linting for controller * fix test * test * Revert some tests * Guess not * see if this sticks * fixes * Fix linters. Add --video if not provided * Checkout develop tests for keys * Release time * Revert papermill and update gh pages action * Fix shortname (#4356) * uninstall brotli on conda test * Fix issue 4316 (#4357) * Fix issue 4316 * Updating polygon_model + options_controller * Tests : FRED * ruff --------- Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: colin99d <colin99delahunty@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> * Release/2.5.1 (#4368) * Fix routine script * Update SDK generation scripts * This needed fixing anyways * Regenerate SDK files * Update paths in sdk helpers * Regenerate the remains of the SDK * Fix candle not working with symbol via the sdk * Fix pydocstyle errors * deps * Add in Docstrings * Push to website since I need to upload images * typos * Add in Fixed Income Guide * Tests : fix cassette * changes to layout and adding more content * trailmap * poetry * updates to requirements files * add `_try_to_login` to sdk generation, fix `_chart` in `about()` url * sentiment analysis * refactor * changing to base model default * rounding * renewing poetry * fixed poetry * spacing * black * adds selectable models for realized volatility calculations * fixes line too long * Add intro guides to Fixed Income * Fix some missing docstrings * Fix website not working * missed a few * fix /economy/test_yfinance_view tests * fix etf/test_stockanalysis_model.py * fix etf/test_stockanalysis_view.py * fix test_stocks_controller * deprecating non used function * update financedatabase to 2.0.4 * Delete SIA from OpenBB Docs and SDK * Searching was not done properly for short name and index * changes the default data source for crypto.load * Fix tests I broke * Little fixy fix to remove duplicates * Fix tests * typo * adds check for empty dataframe * Patch Equity Report * Update so that image links to website * linting v2 * silly imports * adding tempfile * add imap unordered * reordering imports * Adding databento as a source (#4293) * First commit * Baby steps * Keys and sdk * Fix import for api key * Add SDK endpoints * Test + api checks * tests * roque print of api key * Changes * minor * custom timeout * improve timeouts --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Tests * Integration test * frozendict remove * update spec * rename sdk faq to troubleshooting * add hidden import * add hidden imports * imports again * valid url check * new lines and prompt * split imports * more spec * adds cones to the crypto-ta menu * Fix tests * Update code to reflect new changes to FinanceDatabase * Small bugfix for DCF if you have no ticker loaded * remove yfinance from news * add reverse fx choices * black * ruff * Add options greeks to the SDK * Linting * Delete rogue file and update test and add fixedincome to en.yml * fix for options screener * ruff * updates tests for options screener * reqs * updates more test files * rewrite for test_github_model * rewrite test for test_syncretism_view * removes test_view_available_presets[] * black * coverage * adds option screener preset * Update directories.py * len & set * set all list * adds unit testing for cones * ruff * pylint * adds options screener endpoint to SDK * test markers * Testing draft PR mode * Update package to v2.0.7 * Remove etf/screener and tests * Updated * Merge reqs * Updated readme * hook test for pyinstaller * Little fixy fix * Remove etf/scr from SDK * Update tests * Update hook-whisper.py * oops lol * Update sdk * update * Etf * removed old trailmap csv's * Update fixedincome text * add greeks to trail * rouge file * merge killed it * fix test * fix build failure * catch for error message * fix for frozendict * caching search and prompting on hub * whisper model prompts * Fix long/short issue and fix transform issue * separates volatility models from cones function * Introduce CPI functionality * improves error handling for volatility models when window length is too small * ur welcome <3 * additional sanity check for volatility_view * updates volatility_model test * black * Fix linting * Make cpi a little bit more robust * Add in missing value * sdk updates * update dep files * Update trail_map_forecasting.csv * import ordering pylint? * fix trailing comma * sorted trailmaps * remove one test artifact * rewrite test * Adds the missing pieces. * adds clickable URL in keys + Databento * adds databento images * adds images for Databento * update deps * req files * swap order in databento * ruff * mypy * lint * sdk * makes requested changes * ruff v2.. * replaces screenshot. * Removed because it shouldn't have been in this PR. * ruff v3 * Minor edit, move installation to position 2 instead of last * util linting changes * linting for controller * fix test * test * Revert some tests * Guess not * see if this sticks * fixes * Fix linters. Add --video if not provided * Checkout develop tests for keys * merge release into develop (#4359) * Update trailmap.py (#4300) * Fixes Failing AutoDocs (#4304) * Fixes Failing AutoDocs * Update test_print_help.txt * Release time * Revert papermill and update gh pages action * Fix shortname (#4356) * uninstall brotli on conda test * Fix issue 4316 (#4357) * Fix issue 4316 * Updating polygon_model + options_controller * Tests : FRED * ruff --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Chavithra <chavithra@gmail.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * Add pydantic to reqs and get ffmpeg in docker image * initialize session (#4360) * Unpin old version of jsonschema (#4365) * puts pip install openbb[all] inside quotes (#4366) Co-authored-by: James Maslek <jmaslek11@gmail.com> * Merge deps * Hotfix/bug #3837 (#3942) * Fix: Fixed spaces causing error in --sort flag at crypto/disc/... * Fixed minor issues * fixed formatting using black * Ran tests locally * fixed top command * reverse flag to gainers * reverse flag to losers * fixed dappradar verbose exceptions * tests * tests * tests --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> * Update release files --------- Co-authored-by: jeroen <jer.bouma@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: colin99d <colin99delahunty@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Brendan de Faria <brendan.defaria@gmail.com> * hotfix/Fix troubleshooting and adding lines (#4379) * Release Branch * fix print_pretty_prediction, avoid error on DummyBackend.__version__ * Update gh-pages.yml * fix removed start_required_configurations * fix gh-pages yarn lockfile, integration tests libs * ship it --------- Co-authored-by: teh_coderer <me@tehcoderer.com> Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com> Co-authored-by: Jeroen Bouma <jer.bouma@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: Chavithra PARANA <chavithra@gmail.com> Co-authored-by: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: northern-64bit <75195383+northern-64bit@users.noreply.github.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: colin99d <colin99delahunty@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com> Co-authored-by: Brendan de Faria <brendan.defaria@gmail.com>
OpenBB Workflows
This directory contains the workflows for the OpenBB 🦋 Project. The workflows are:
| Workflows | Summary |
|---|---|
| branch-name-check.yml | Checks if the branch name is valid and follows the naming convention. |
| build-release.yml | Builds the project and runs the tests. |
| docker.yml | Builds the docker image and pushes it to the docker hub. |
| draft.yml | Creates a draft release when a new tag is pushed. |
| gh-pages.yml | Builds the documentation and deploy to github pages. |
| integration-test.yml | Runs the integration tests. |
| intel_macos_build.yml | Builds the project on Intel Macs. |
| issue.yml | Creates an issue when a new bug is reported. |
| labels.yml | Adds labels to the issues and pull requests. |
| linting.yml | Runs the linters. |
| m1_macos_build.yml | Builds the project on M1 Macs. |
| mac.yml | Builds the project on Mac OS X Full Clean Build with ML. |
| nightly-build.yml | Builds the project and runs the integration tests every night on the develop branch. |
| pypi.yml | Publishes the package to PyPI. |
| nightly-pypi.yml | Publishes the package to PyPI every night on the develop branch. |
| unit-test.yml | Runs the unit tests. |
| windows.yml | Builds the project on Windows 10 Full Clean Build with ML. |
| windows10_build.yml | Builds the project on Windows 10. |
Branch Name Check Workflow
Objective: To check if pull request branch names follow the GitFlow naming convention before merging.
Triggered by: A pull request event where the target branch is either develop or main.
Branches checked: The source branch of a pull request and the target branch of a pull request.
Steps:
-
Extract branch names: Using the jq tool, the source and target branch names are extracted from the pull request event. The branch names are then stored in environment variables and printed as output.
-
Show Output result for source-branch and target-branch: The source and target branch names are printed to the console.
-
Check branch name for develop PRs: If the target branch is develop, then the source branch is checked against a regular expression to ensure that it follows the GitFlow naming convention. If the branch name is invalid, a message is printed to the console and the workflow exits with a status code of 1.
-
Check branch name for main PRs: If the target branch is main, then the source branch is checked against a regular expression to ensure that it is either a hotfix or a release branch. If the branch name is invalid, a message is printed to the console and the workflow exits with a status code of 1.
Note: The GitFlow naming convention for branches is as follows:
- Feature branches: feature/
- Hotfix branches: hotfix/
- Release branches: release/<major.minor.patch>(rc)
Build Release Workflow
This GitHub Actions workflow is responsible for building and releasing software for multiple platforms (Windows, M1 MacOS, Intel MacOS, and Docker). The workflow has four jobs:
trigger-windows-buildtrigger-macos-buildtrigger-intel-buildtrigger-docker-build
Each job uses the aurelien-baudet/workflow-dispatch action to trigger another workflow, respectively windows10_build.yml, m1_macos_build.yml, intel_macos_build.yml, and docker.yml. The GITHUB_TOKEN is passed as a secret so that the triggered workflows have access to the necessary permissions. The wait-for-completion-timeout is set to 2 hours, which is the maximum amount of time the job will wait for the triggered workflow to complete.
Docker Workflow
This GitHub Actions workflow is responsible for building and pushing the docker image to the itHub Container Registry. This workflow is triggered when a new change is pushed to the main branch of the repository, and the Docker image is published to the GitHub Container Registry.
Steps
-
Checkout Code: This step checks out the code from the GitHub repository.
-
Login to GitHub Container Registry: This step logs into the GitHub Container Registry using the GitHub Actions token.
-
Setup Commit Hash: This step sets the commit hash of the code that is being built.
-
Build Env File: This step builds the environment file for the Docker image.
-
Building the Docker Image: This step builds the Docker image using the scripts in the
build/dockerdirectory. -
Publishing the Docker Image: This step publishes the Docker image to the GitHub Container Registry. The Docker image is only pushed to the registry if the branch being built is
main.
Draft Workflow
This GitHub Actions workflow is designed to automatically generate and update draft releases in a GitHub repository. The workflow is triggered when it is manually dispatched, allowing you to control when the draft releases are updated.
GH Pages Workflow
This GitHub Actions workflow is responsible for building the documentation and deploying it to GitHub Pages. This workflow is triggered when a new change is pushed to the main or release branch of the repository, and the documentation is published to GitHub Pages.
Integration Test Workflow
This GitHub Action is used to run integration tests on your code repository. It is triggered on pushes to the release/* or main branches, and it runs on the latest version of Ubuntu.
The workflow consists of the following steps:
- Check out the code from the repository
- Set up Python 3.9
- Install Poetry, a package and dependency manager for Python
- Load a cached virtual environment created by Poetry, to speed up the process if possible
- Install dependencies specified in the
poetry.lockfile - Run the integration tests using the
terminal.pyscript - Upload a summary of the test results to Slack
The results of the tests are captured in a file called result.txt. The summary of the tests, including information about failed tests, is then uploaded to Slack using the adrey/slack-file-upload-action GitHub Action.
Intel MacOS Build Workflow
This GitHub Actions workflow is responsible for building and testing the project on Intel Macs. The workflow is triggered by the workflow_dispatch event, which means it can be manually triggered. The concurrency group for the job is defined based on the Github workflow and the Github ref, and it is set to cancel in-progress runs.
The job named Build has several steps:
- Checkout the repository's main branch.
- Git log to see the history of the repository.
- Install
create-dmgusing Homebrew. - Clean up previous environment variables and set PATH to default.
- Set up conda environment caching.
- Set up Miniconda using the
build/conda/conda-3-9-env-full.yamlfile. - Use Poetry to install the necessary dependencies.
- Install Pyinstaller.
- Install Portfolio Optimization and Forecasting Toolkits.
- Install a specific version of Papermill using pip.
- Build the bundle using Pyinstaller and do some additional tasks such as setting up icons.
- Create a keychain and decode a certificate using a password stored in Github secrets.
- Code sign specific binaries using the certificate and password from the previous step.
This workflow builds the OpenBB Terminal application on MacOS and signs it with a certificate to allow it to run on the MacOS system.
Linting Workflow
This GitHub Actions workflow is responsible for running linting checks on the codebase. This workflow is triggered on pull request events such as opened, synchronize, and edited, and push events on branches with names that start with feature/, hotfix/, or release/. The workflow also sets a number of environment variables and uses Github Actions caching to improve performance.
It consists of two jobs: code-linting and markdown-link-check.
The first job, code-linting, runs on an Ubuntu machine and performs several linting tasks on the code in the repository, including:
- Checking out the code from the repository
- Setting up Python 3.9
- Installing a number of Python packages necessary for the linting tasks
- Running
banditto check for security vulnerabilities - Running
blackto check the code formatting - Running
codespellto check the spelling of comments, strings, and variable names - Running
ruffto check the use of Python - Running
mypyto check the type annotations - Running
pyupgradeto upgrade Python 2 code to Python 3 - Running
pylintto perform static analysis of the code
The second job, markdown-link-check, runs on an Ubuntu machine and performs linting of the markdown files in the repository. It uses a Docker container avtodev/markdown-lint to perform the linting.
MacOS Build Workflow
This GitHub Actions workflow is used to build a version of the OpenBB Terminal for M1 MacOS. The build process includes installing necessary dependencies, building the terminal application using PyInstaller, creating a DMG file for distribution, and running integration tests on the built application.
Jobs
The workflow consists of a single job named Build which runs on self-hosted MacOS systems with ARM64 architecture. The job performs the following steps:
- Checkout: The main branch of the repository is checked out, allowing for the commit hashes to line up.
- Git Log: The log of the Git repository is displayed.
- Install create-dmg: The
create-dmgtool is installed using Homebrew. - Clean Previous Path: The previous PATH environment variable is cleared and restored to its default values.
- Setup Conda Caching: The miniconda environment is set up using a caching mechanism for faster workflow execution after the first run.
- Setup Miniconda: Miniconda is set up using the
conda-3-9-env-full.yamlenvironment file, with channelsconda-forgeanddefaults, and with thebuild_envenvironment activated. - Run Poetry: Poetry is used to install the dependencies for the project.
- Install PyInstaller: PyInstaller is installed using Poetry.
- Poetry Install Portfolio Optimization and Forecasting Toolkits: The portfolio optimization and forecasting toolkits are installed using Poetry.
- Install Specific Papermill: A specific version of Papermill is installed using pip.
- Build Bundle: The terminal application is built using PyInstaller, with icons and assets copied to the DMG directory.
- Create DMG: The DMG file is created using the
create-dmgtool. - Clean up Build Artifacts: The build artifacts such as the terminal directory and DMG directory are removed.
- Save Build Artifact DMG: The DMG file is saved as a build artifact.
- Convert & Mount DMG: The DMG file is converted and mounted.
- Directory Change: The current directory is changed to the mounted DMG file.
- Unmount DMG: The mounted DMG file is unmounted.
- Run Integration Tests: The built terminal application is run with integration tests, and the results are displayed.
Finally, the integration tests are run and the results are logged. The workflow is configured to run only when triggered by a workflow dispatch event and runs in a concurrent group, with the ability to cancel in-progress jobs.
Nightly Build Workflow
This code is a GitHub Actions workflow configuration file that is used to trigger other workflows when certain events occur. The main purpose of this workflow is to trigger builds on different platforms when a release is made or a pull request is made to the main branch.
This workflow is triggered at UTC+0 daily by the GitHub Action schedule event.
The job includes the following steps:
-
Trigger Windows Build: This step uses the
aurelien-baudet/workflow-dispatchaction to trigger the windows10_build.yml workflow. -
Trigger macOS Build: This step uses the
aurelien-baudet/workflow-dispatchaction to trigger the m1_macos_build.yml workflow -
Trigger Intel Build: This step uses the
aurelien-baudet/workflow-dispatchaction to trigger the intel_macos_build.yml workflow -
Trigger Docker Build: This step uses the
aurelien-baudet/workflow-dispatchaction to trigger the docker.yml workflow
This workflow also uses a concurrency setting that groups the jobs by the workflow and ref, and cancels any in-progress jobs.
Nightly PyPI Publish Workflow
This workflow is used to publish the latest version of the OpenBB Terminal to PyPI. The workflow is triggered at UTC+0 daily by the GitHub Action schedule event.
It does this by first updating the pyproject.toml file with a pre-determined version string of the form <currentVersion>.dev<date>, where <date> represents the current day's date as a 8 digit number.
Then, the code installs pypa/build and uses python -m build to create a binary wheel and a source tarball in the dist/ directory.
Finally, it uses the PyPA specific action gh-action-pypi-publish to publish the created files to PyPI.
PYPI publish Workflow
The Github Action code Deploy to PyPI is used to deploy a Python project to PyPI (Python Package Index) and TestPyPI, which is a separate package index for testing purposes. The code is triggered on two events:
-
Push event: The code is triggered whenever there is a push to the
release/*andmainbranches. -
Workflow dispatch event: The code can be manually triggered by the workflow dispatch event.
The code sets the concurrency to the group and the option cancel-in-progress is set to true to ensure that the running jobs in the same group are cancelled in case another job is triggered.
The code contains two jobs, deploy-test-pypi and deploy-pypi, both of which have the same steps with slight variations.
The deploy-test-pypi job is triggered only if the pushed branch starts with refs/heads/release/. This job sets up the Python environment, installs the build package using pip, builds binary wheel and source tarball using build, and finally, publishes the distributions to TestPyPI using the pypa/gh-action-pypi-publish@release/v1 Github Action. The password to access TestPyPI is stored as a secret named TEST_PYPI_API_TOKEN.
Similarly, the deploy-pypi job is triggered only if the pushed branch starts with refs/heads/main. This job follows the same steps as deploy-test-pypi, but the distributions are published to PyPI instead of TestPyPI. The password to access PyPI is stored as a secret named PYPI_API_TOKEN.
Note: The code uses the pypa/build package for building the binary wheel and source tarball, and the pypa/gh-action-pypi-publish@release/v1 Github Action for publishing the distributions to PyPI and TestPyPI.
Unit Tests Workflow
This workflow is used to run unit tests on the OpenBB Terminal. The workflow is triggered on the following events: The events this workflow will respond to are:
-
Pull requests that are opened, synchronized, edited, or closed. The pull request must be made to the
developormainbranches. -
Pushes to the
release/*branches.
Each job in the workflow specifies a set of steps that are executed in order.
The first job, check-files-changed, checks whether there are any changes to certain file types in the repository, such as Python files and lockfiles. If there are changes, then the check-changes output variable is set to true.
The next job, base-test, runs a series of tests if check-changes is true and the base branch of the pull request is develop. This job sets up a Python 3.9 environment, installs Poetry, and then runs tests using pytest. Finally, it starts the terminal and exits.
The next job, tests-python, runs tests for different versions of Python (3.8, 3.9, and 3.10) on the ubuntu-latest operating system. It sets up the specified Python version, installs Poetry and dependencies, and then runs tests using pytest.
The next job, full-test, uses the GitHub Actions checkout action to checkout the code, followed by the setup-python action to set up the specified version of Python. Then, the install-poetry action is used to install the package manager Poetry, and a cache is set up using the actions/cache action to avoid re-installing dependencies. After that, the dependencies are installed using Poetry, and a list of installed packages is displayed. Then, the tests are run using pytest, and finally, the terminal.py script is started and exited.
The last job, tests-conda, sets up a Miniconda environment using the setup-miniconda action. The environment is specified using a YAML file and is activated. Then, the tests are run.
Windows 10 Build Workflow
This is a GitHub Actions workflow file that automates the build and testing process for the OpenBB Terminal on Windows 10. The workflow consists of two jobs:
- Windows-Build
- Build-Exe
- The Windows-Build job does the following:
- Sets up the Windows Git configuration for long file paths.
- Checks out the repository code.
- Sets up Python 3.9 and creates an OpenBB environment using poetry.
- Installs necessary packages and builds the terminal using PyInstaller.
- Uploads the built artifact to GitHub as an artifact.
- The Build-Exe job does the following:
- Sets up the Windows Git configuration for long file paths.
- Checks out the repository code.
- Downloads the built artifact from the previous Windows-Build job.
- Copies the files into an app folder for building the EXE file.
- Builds the EXE file using NSIS.
- Uploads the built EXE as an artifact to GitHub.
- Runs integration tests on the terminal and saves the results to a text file.
- Uploads the test results summary to Slack.
- Cleans up previous build files and artifacts.
This workflow is triggered by the workflow_dispatch event and runs in concurrency with other workflows in the same group, with the ability to cancel in-progress builds. The concurrency group is defined as ${{ github.workflow }}-${{ github.ref }}.