fix use symbol to get instrument error #1564
This file contains hidden or 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-22.04 | |
| strategy: | |
| matrix: | |
| python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| # Checks out a copy of your repository on the ubuntu-latest machine | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # 获取完整的 git 历史,而不是 shallow clone | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache dependencies | |
| # cache will change when runner.os or requirements.txt changed | |
| uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: | | |
| ~/.cache/pip | |
| ~/.local | |
| /usr/local/lib/ta-lib | |
| key: ${{ runner.os }}-py-${{ matrix.python-version }}-deps-${{ hashFiles('**/requirements.txt') }} | |
| - name: Install Python dependencies | |
| 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 | |
| # Install numpy based on Python version | |
| pip install build | |
| if python -c "import sys; exit(0 if sys.version_info < (3, 12) else 1)"; then | |
| pip install "numpy<2.0.0" | |
| pip install TA-Lib==0.4.38 -i https://rquser:[email protected]/simple/ | |
| else | |
| pip install "numpy>=2.0.0" | |
| pip install "TA-Lib>=0.6.5" -i https://rquser:[email protected]/simple/ | |
| fi | |
| pip install pytest | |
| pip install pytest-cov | |
| pip install coveralls | |
| pip install -U setuptools | |
| pip install ipython==5.3.0 | |
| pip install -e . | |
| # download-bundle | |
| rqalpha download-bundle | |
| - name: run test | |
| run: | | |
| pytest --cov=rqalpha --cov-report= | |
| 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: | | |
| python -m 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 | |
| python -m coveralls --finish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |