diff --git a/.github/workflows/deploy-pypi-nightly.yml b/.github/workflows/deploy-pypi-nightly.yml deleted file mode 100644 index 26c930f120e..00000000000 --- a/.github/workflows/deploy-pypi-nightly.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy to PyPI - Nightly - -on: workflow_dispatch - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - deploy-nightly-pypi: - name: Build and publish nightly distributions 📦 to PyPI - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install pypa/build - run: >- - python -m - pip install - build - - - name: OpenBB Platform - Update version in pyproject.toml and Edit docs - run: | - sed -i 's/name = ".*"/name = "openbb-nightly"/' openbb_platform/pyproject.toml - sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" openbb_platform/pyproject.toml - - - name: OpenBB Platform - Create the dynamically generated wheel - run: | - python -m pip install poetry toml - python build/pypi/openbb_platform/nightly.py - - - name: OpenBB Platform - Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: openbb_platform/dist/ - password: ${{ secrets.NIGHTLY_PYPI_API_TOKEN }} diff --git a/.github/workflows/deploy-test-pypi.yml b/.github/workflows/deploy-test-pypi.yml deleted file mode 100644 index 6881dc59471..00000000000 --- a/.github/workflows/deploy-test-pypi.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Deploy the OpenBB Platform to Test PyPI - -on: - push: - branches: - - feature/v4-pypi - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - deploy-test-pypi: - name: Build and publish 📦 to TestPyPI - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - - name: OpenBBTerminal - Update version in pyproject.toml and Edit docs - run: | - sed -i 's/name = ".*"/name = "openbb-terminal-nightly"/' pyproject.toml - sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" pyproject.toml - sed -i 's|pip install openbb-terminal|pip install openbb-terminal-nightly|g' ./website/pypi.md - - - name: OpenBBTerminal - Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . - - - name: OpenBBTerminal - Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist/ - password: ${{ secrets.TEST_PYPI_API_TOKEN_OBB_TERMINAL_NIGHTLY }} - repository-url: https://test.pypi.org/legacy/ - - - name: OpenBB Platform - Update version in pyproject.toml and Edit docs - run: | - sed -i 's/name = ".*"/name = "openbb-nightly"/' openbb_platform/pyproject.toml - sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d%H%M)\"/" openbb_platform/pyproject.toml - - - name: OpenBB Platform - Create the dynamically generated wheel - run: | - python -m pip install poetry toml - python build/pypi/openbb_platform/nightly.py - - - name: OpenBB Platform - Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: openbb_platform/dist/ - password: ${{ secrets.TEST_PYPI_API_TOKEN_OBB_PLATFORM_NIGHTLY }} - repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 74ceeaf65a0..fc55b42cf79 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -15,6 +15,9 @@ on: jobs: update_release_draft: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read steps: - name: 📟 Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/general-linting.yml b/.github/workflows/general-linting.yml index fa5383a1975..d9002922a64 100644 --- a/.github/workflows/general-linting.yml +++ b/.github/workflows/general-linting.yml @@ -23,6 +23,8 @@ jobs: code-linting: name: General Code Linting runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout Code uses: actions/checkout@v4.1.1 # actions/checkout v3.0.2 @@ -74,6 +76,8 @@ jobs: markdown-link-check: name: Markdown Linting runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v4 name: Check out the code @@ -85,6 +89,8 @@ jobs: json-yaml-validate: name: JSON Check runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/gh-branch-name-check.yml b/.github/workflows/gh-branch-name-check.yml index 420f685da38..ad2a30df7c1 100644 --- a/.github/workflows/gh-branch-name-check.yml +++ b/.github/workflows/gh-branch-name-check.yml @@ -14,6 +14,9 @@ concurrency: jobs: check-branch-name: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/gh-pr-labels.yml b/.github/workflows/gh-pr-labels.yml index 6c79f1d91eb..81d6253fb93 100644 --- a/.github/workflows/gh-pr-labels.yml +++ b/.github/workflows/gh-pr-labels.yml @@ -7,6 +7,9 @@ on: jobs: label: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: # - uses: mheap/github-action-required-labels@v1 # with: diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 8ef00f318c4..c24be39164d 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -17,6 +17,8 @@ jobs: M1-MacOs-Build: name: M1 MacOS Build runs-on: [self-hosted, macos, ARM64] + permissions: + contents: read steps: # Checkout repository main branch. this allows for the commit hashes to line up - name: Checkout @@ -119,6 +121,8 @@ jobs: Intel-MacOs-Build: name: Intel MacOS Build runs-on: [self-hosted, macos, x64] + permissions: + contents: read steps: # Checkout repository main branch. this allows for the commit hashes to line up - name: Checkout diff --git a/.github/workflows/test-integration-platform.yml b/.github/workflows/test-integration-platform.yml deleted file mode 100644 index ac083e71e34..00000000000 --- a/.github/workflows/test-integration-platform.yml +++ /dev/null @@ -1,115 +0,0 @@ -name: 🚉 Integration test Platform (API) - -on: - workflow_dispatch: - pull_request: - branches: - - release/* - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - api-integration-tests: - runs-on: ubuntu-latest - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - OPENBB_API_AUTH: true - OPENBB_API_USERNAME: "USER" - OPENBB_API_PASSWORD: "PASS" - - steps: - - name: Slack Notification - Starting - uses: act10ns/slack@v1 - with: - status: starting - channel: "#workflows" - message: Starting API Integration Test... - if: always() - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Checkout specific ref - if: github.event_name == 'pull_request' - run: git fetch origin ${{ github.event.pull_request.head.ref }} && git checkout FETCH_HEAD - - - name: Setup Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - architecture: x64 - - - name: Install Dependencies - run: | - python -m venv runner_env - source runner_env/bin/activate - pip install poetry toml - python openbb_platform/dev_install.py -e - - - name: Populate System Setting Files - run: | - mkdir -p ~/.openbb_platform - touch ~/.openbb_platform/system_settings.json - echo '{"log_collect":false}' > ~/.openbb_platform/system_settings.json - cat ~/.openbb_platform/system_settings.json - - - name: Create and Populate user_settings.json from GitHub Secrets - run: | - touch ~/.openbb_platform/user_settings.json - echo '{ - "credentials": { - "benzinga_api_key": "${{ secrets.BENZINGA_API_KEY }}", - "fmp_api_key": "${{ secrets.FMP_API_KEY }}", - "polygon_api_key": "${{ secrets.POLYGON_API_KEY }}", - "alpha_vantage_api_key": "${{ secrets.ALPHA_VANTAGE_API_KEY }}", - "fred_api_key": "${{ secrets.FRED_API_KEY }}", - "intrinio_api_key": "${{ secrets.INTRINIO_API_KEY }}", - "tradingeconomics_api_key": "${{ secrets.TRADINGECONOMICS_API_KEY }}", - "quandl_api_key": "${{ secrets.QUANDL_API_KEY }}", - "biztoc_api_key": "${{ secrets.BIZTOC_API_KEY }}", - "nasdaq_api_key": "${{ secrets.NASDAQ_API_KEY }}", - "tiingo_token": "${{ secrets.TIINGO_TOKEN }}" - } - }' > ~/.openbb_platform/user_settings.json - - - name: Build openbb - run: | - source runner_env/bin/activate - python -c "import openbb; openbb.build()" - - - name: Launch the Uvicorn Process - run: | - source runner_env/bin/activate - uvicorn openbb_core.api.rest_api:app --host 0.0.0.0 --port 8000 --reload & - - - name: Wait for 42 seconds - run: sleep 42 - - - name: Check installed packages - run: | - source runner_env/bin/activate - pip list - - - name: Run Integration Tests - run: | - source runner_env/bin/activate - pytest openbb_platform -m integration - - - name: Upload summary to Slack - uses: adrey/slack-file-upload-action@master - with: - token: ${{ secrets.SLACK_API_TOKEN }} - initial_comment: "API Integration test summary" - title: "Integration test summary" - path: summary.txt - channel: ${{ secrets.SLACK_CHANNEL_ID }} - - - name: Slack Notification - Success/Failure - uses: act10ns/slack@v1 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: "#workflows" - if: always() diff --git a/.github/workflows/test-unit-cli.yml b/.github/workflows/test-unit-cli.yml index a7943a21930..49612880e4e 100644 --- a/.github/workflows/test-unit-cli.yml +++ b/.github/workflows/test-unit-cli.yml @@ -14,6 +14,8 @@ concurrency: jobs: unit_tests: runs-on: ubuntu-latest + permissions: + contents: read strategy: fail-fast: false @@ -36,7 +38,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('cli/poetry.lock') }} + key: ${{ runner.os }}-pip-${{ matrix.python_version }}-${{ hashFiles('cli/poetry.lock') }} restore-keys: | ${{ runner.os }}-pip- diff --git a/.github/workflows/test-unit-platform.yml b/.github/workflows/test-unit-platform.yml index 362152bc672..37ab4d0ba08 100644 --- a/.github/workflows/test-unit-platform.yml +++ b/.github/workflows/test-unit-platform.yml @@ -14,6 +14,8 @@ concurrency: jobs: unit_tests: runs-on: ubuntu-latest + permissions: + contents: read strategy: fail-fast: false @@ -36,7 +38,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('openbb_platform/poetry.lock') }} + key: ${{ runner.os }}-pip-${{ matrix.python_version }}-${{ hashFiles('openbb_platform/poetry.lock') }} restore-keys: | ${{ runner.os }}-pip-