Trying 7 with limit orders. #172
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: tests | |
on: | |
push: | |
paths-ignore: | |
- "README.md" | |
- "*/**/*.html" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: ["ubuntu-latest"] | |
python: ["3.10", "3.11"] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install TA-Lib | |
uses: knicknic/os-specific-run@v1.0.3 | |
with: | |
linux: | | |
sudo apt update | |
sudo apt install wget -y | |
sudo apt install software-properties-common -y | |
sudo add-apt-repository ppa:deadsnakes/ppa -y | |
sudo apt-get install build-essential -y | |
sudo apt install python3.10-dev -y | |
sudo apt-get install python3-dev -y | |
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | |
tar -xzf ta-lib-0.4.0-src.tar.gz | |
cd ta-lib | |
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' | |
wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub' | |
./configure --prefix=/usr | |
make | |
sudo make install | |
pip install ta-lib | |
macos: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
brew install ta-lib | |
windows: | | |
pip install dependencies/TA_Lib-0.4.24-cp310-cp310-win_amd64.whl | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install -r requirements.txt | |
- name: Inject keys | |
uses: knicknic/os-specific-run@v1.0.3 | |
with: | |
linux: | | |
echo -en '${{ secrets.KEYS_INI }}' >> keys.ini | |
macos: | | |
echo -en '${{ secrets.KEYS_INI }}' >> keys.ini | |
windows: | | |
New-Item "keys.ini" -ItemType File -Value "${{ secrets.KEYS_INI }}" | |
- name: Initialize test dependencies | |
run: pip install -r tests/requirements.txt | |
- name: Run tests with pytest | |
run: python -m pytest --cov | |
- name: Update tests coverage badge | |
if: ${{ ( success() || failure() ) && matrix.os == 'ubuntu-latest' && matrix.python == '3.10' }} | |
continue-on-error: true | |
run: | | |
coverage-badge -o tests/badge.svg -f | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git pull | |
git add tests/badge.svg | |
git commit --author="Prerit Das <preritdas@gmail.com>" -m "Update coverage badge post unit tests." | |
git push |