Windows10 Build #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows10 Build | |
env: | |
OPENBB_ENABLE_QUICK_EXIT: true | |
OPENBB_LOG_COLLECT: false | |
OPENBB_USE_PROMPT_TOOLKIT: false | |
PIP_DEFAULT_TIMEOUT: 100 | |
PYTHONNOUSERSITE: 1 | |
on: workflow_dispatch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Windows-Build: | |
name: Windows10 Build ENV | |
runs-on: windows-latest | |
# Configuring ------------- | |
steps: | |
- name: Setup Windows Git Configuration # This is under the assumption that git is already installed on the system | |
run: | | |
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1 | |
git config --system core.longpaths true | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python & Create OpenBB Environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Create and start virtual environment | |
run: | | |
python -m venv venv --upgrade-deps | |
source venv/Scripts/activate | |
python -m pip install setuptools==65.4.1 wheel | |
python -m pip install -r requirements-full.txt --no-cache-dir | |
python -m pip uninstall papermill -y | |
python -m pip install git+https://github.com/nteract/papermill.git@main | |
python -m PyInstaller build/pyinstaller/terminal.spec --clean | |
pwd | |
shell: bash | |
- name: zip the file | |
run: | | |
Get-Location | |
Compress-Archive dist release.zip | |
shell: pwsh | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OpenBB-Windows10-ENV | |
path: release.zip | |
Build-Exe: | |
name: Windows10 Build-Exe | |
runs-on: [self-hosted, Windows, x64] | |
needs: Windows-Build | |
# Configuring ------------- | |
steps: | |
- name: Setup Windows Git Configuration # This is under the assumption that git is already installed on the system | |
run: | | |
Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1 | |
git config --system core.longpaths true | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: OpenBB-Windows10-ENV | |
path: . | |
- name: unzip artifact for deployment | |
run: Expand-Archive release.zip -DestinationPath . | |
shell: pwsh | |
- name: Move Files into App Folder | |
run: cp -r .\dist\OpenBBTerminal\ .\build\nsis\app\ | |
# don't need this because log collection is turned off | |
# - name: Remove Log Data | |
# run: Remove-Item .\build\nsis\app\openbb_terminal\logs\ -Recurse | |
- name: Build Exe File | |
run: | | |
C:\'.\Program Files (x86)\'\nsis\makensis.exe .\build\nsis\setup.nsi | |
# This should autosign the installer now - We really need to only do this when needed though. ON RELEASE | |
- name: Sign Installer | |
if: startsWith(github.ref, 'refs/heads/main') | |
run: | | |
& 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 0bf95b74b3b8763434e1782df36052d42c5c0bef 'C:\Users\Administrator\actions-runner\_work\OpenBBTerminal\OpenBBTerminal\build\nsis\OpenBB Terminal Setup.exe' | |
- name: Save Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Windows EXE Artifact | |
path: '.\build\nsis\OpenBB Terminal Setup.exe' | |
- name: Run Integration Tests | |
run: | | |
dist\OpenBBTerminal\OpenBBTerminal.exe -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt | |
Select-String "================================ Integration Test Summary ================================" result.txt -Context 0,100 | Select-Object -Last 2000 | Out-File summary.txt | |
Write-output `n >> summary.txt | |
- name: Run Integration Tests Coverage Report | |
run: | | |
dist\OpenBBTerminal\OpenBBTerminal.exe -t --coverage | tee result.txt | |
Select-String "============================== Integration Coverage Summary ==============================" result.txt -Context 0,300 | Select-Object -Last 2000 >> summary.txt | |
- name: Upload summary to Slack | |
uses: adrey/slack-file-upload-action@master | |
with: | |
token: ${{ secrets.SLACK_API_TOKEN }} | |
initial_comment: "Windows Build Integration test summary" | |
title: "Windows Build Integration test summary" | |
path: summary.txt | |
channel: ${{ secrets.SLACK_CHANNEL_ID }} | |
# Cleaning ------------------------ | |
# Make sure to add Remove-Item C:\Users\Administrator\Desktop\OPENBB-exports -Recurse whenever integration tests get fixed | |
- name: Remove Previous Build | |
run: | | |
Remove-Item '.\build\nsis\OpenBB Terminal Setup.exe' -Recurse | |
Remove-Item .\build\nsis\app\ -Recurse | |
Remove-Item .\dist\ -Recurse |