Dependency Update #48
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
# This workflow will update Python dependencies | |
# For more information see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule | |
name: Dependency Update | |
on: | |
schedule: | |
- cron: "0 4 1 * *" | |
# 12am EST | |
workflow_dispatch: | |
env: | |
# RUN_ID is necessary for tests | |
RUN_ID: ${{ github.run_id }} | |
RH_USERNAME: ${{ secrets.RH_USERNAME }} | |
RH_PASSWORD: ${{ secrets.RH_PASSWORD }} | |
RH_2FA: ${{ secrets.RH_2FA }} | |
GLASSNODE: ${{ secrets.GLASSNODE }} | |
BLS: ${{ secrets.BLS }} | |
BINANCE_TESTNET_KEY: ${{ secrets.BINANCE_TESTNET_KEY }} | |
BINANCE_TESTNET_SECRET: ${{ secrets.BINANCE_TESTNET_SECRET }} | |
KRAKEN_KEY: ${{ secrets.KRAKEN_KEY }} | |
KRAKEN_SECRET: ${{ secrets.KRAKEN_SECRET }} | |
POLYGON: ${{ secrets.POLYGON }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
PREF_EXCHANGE: ${{ secrets.PREF_EXCHANGE }} | |
TEST: true | |
GLASSNODE_PASS: ${{ secrets.GLASSNODE_PASS }} | |
ALPACA_PAPER: ${{ secrets.ALPACA_PAPER }} | |
ALPACA_PAPER_SECRET: ${{ secrets.ALPACA_PAPER_SECRET }} | |
S3_BUCKET: ${{ secrets.S3_DEV_BUCKET }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Cache pip dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Update dependencies | |
run: python util/update.py | |
- name: Install dependencies | |
run: | | |
pip install flake8 pytest coverage | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics | |
- uses: browser-actions/setup-chrome@v1 | |
with: | |
chrome-version: stable | |
- name: Run all unit tests | |
run: coverage run -m pytest -vv -s | |
- name: Generate test coverage report | |
run: coverage report -m -i --fail-under=95 | |
- name: Update symbols | |
run: python scripts/update_symbols.py | |
# - name: Update dividends | |
# run: python scripts/update_dividends.py | |
# - name: Update splits | |
# run: python scripts/update_splits.py | |
# - name: Update OHLC | |
# run: python scripts/update_ohlc.py | |
# - name: Update intraday | |
# run: python scripts/update_intraday.py | |
- name: Update unemployment | |
run: python scripts/update_unrate.py | |
- name: Update API | |
env: | |
SYMBOL: ${{ secrets.SYMBOL }} | |
run: python scripts/update_api.py | |
- name: Decrypt scripts | |
env: | |
SALT: ${{ secrets.SALT }} | |
run: | | |
python util/decrypt.py encrypted/create_model.py | |
python util/decrypt.py encrypted/predict_signal.py | |
python util/decrypt.py encrypted/optimize_portfolio.py | |
- name: Optimize portfolio | |
run: python encrypted/optimize_portfolio.py | |
- name: Create model | |
run: python encrypted/create_model.py | |
- name: Create visualization | |
run: python scripts/visualize.py | |
- name: Predict signal | |
env: | |
SALT: ${{ secrets.SALT }} | |
EMIT_SECRET: ${{ secrets.DEV_EMIT_SECRET }} | |
run: python encrypted/predict_signal.py | |
- name: Execute order | |
run: python scripts/execute_order.py | |
- name: Commit new file(s) | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
file_pattern: requirements.txt | |
commit_message: "[auto] dep update #patch" | |
commit_user_name: suchak1 | |
commit_user_email: suchak.krish@gmail.com | |
commit_author: Krish Suchak | |
push_options: "--force" | |
- name: Bump version and push tag | |
id: bumpVersion | |
uses: anothrNick/github-tag-action@1.36.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
INITIAL_VERSION: true | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.bumpVersion.outputs.new_tag }} |