CI: Update CI workflows #562
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: CI | |
on: | |
push: { branches: [master] } | |
pull_request: { branches: [master] } | |
schedule: [ cron: '2 2 * * 6' ] # Every Saturday, 02:02 | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9, 3.13] | |
include: | |
- python-version: 3.11 | |
test-type: lint | |
- python-version: 3.11 | |
test-type: docs | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-py${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 3 | |
- name: Fetch tags | |
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- run: pip install -U pip setuptools wheel | |
- if: matrix.test-type == 'lint' | |
run: pip install -U --pre bokeh pandas numpy && pip install -U .[dev] | |
- if: matrix.test-type == 'docs' | |
run: pip install -e .[doc] # -e provides _version.py for pdoc | |
- run: pip install -U .[test] | |
- if: matrix.test-type == 'lint' | |
run: flake8 backtesting setup.py | |
- if: matrix.test-type == 'lint' | |
run: mypy backtesting | |
- if: matrix.test-type == 'lint' | |
env: { BOKEH_BROWSER: none } | |
run: time catchsegv coverage run -m backtesting.test | |
- if: matrix.test-type == 'lint' | |
run: coverage report | |
- if: '! matrix.test-type' | |
env: { BOKEH_BROWSER: none } | |
run: time python -m backtesting.test | |
- if: matrix.test-type == 'docs' | |
run: time doc/build.sh |