Merge pull request #868 from ricequant/develop #1040
Workflow file for this run
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: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache bundle | |
# cache will change when runner.os or requirements.txt changed | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: | | |
$HOME/.cache/pip | |
$HOME/.rqalpha/bundle | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
- name: Install dependencies and download-bundle | |
run: | | |
# Install TA-Lib | |
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | |
tar -xzvf ta-lib-0.4.0-src.tar.gz | |
cd ta-lib | |
./configure --prefix=/usr | |
make | |
sudo make install | |
cd .. | |
# Install Test Deps | |
pip install -U pip | |
pip install "numpy>=1.15.4" | |
pip install TA-Lib | |
pip install coveralls | |
pip install -U setuptools | |
pip install ipython==5.3.0 | |
pip install --prefer-binary . | |
# download-bundle | |
rqalpha download-bundle | |
- name: run test | |
run: | | |
coverage run --source=rqalpha test.py | |
ls -al $HOME/.rqalpha/ | |
ls -al $HOME/.rqalpha/bundle/ | |
- name: Upload coverage data to coveralls.io | |
# https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#configuration | |
# need COVERALLS_REPO_TOKEN | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
COVERALLS_PARALLEL: true | |
run: | | |
coveralls --service=github | |
coveralls: | |
name: Indicate completion to coveralls.io | |
# need secrets.GITHUB_TOKEN | |
needs: test | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Finished | |
run: | | |
pip3 install --upgrade coveralls | |
coveralls --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |