|
5 | 5 | schedule: [ cron: '2 2 * * 6' ] # Every Saturday, 02:02
|
6 | 6 |
|
7 | 7 | jobs:
|
| 8 | + lint: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + timeout-minutes: 1 |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - run: pip install flake8 mypy |
| 14 | + - run: flake8 backtesting setup.py |
| 15 | + - run: mypy --no-warn-unused-ignores backtesting |
| 16 | + |
| 17 | + coverage: |
| 18 | + needs: lint |
| 19 | + runs-on: ubuntu-latest |
| 20 | + timeout-minutes: 4 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + - uses: actions/setup-python@v5 |
| 24 | + with: |
| 25 | + python-version: '3.10' |
| 26 | + - run: pip install -U --pre bokeh pandas numpy coverage && pip install -U .[test] |
| 27 | + - env: { BOKEH_BROWSER: none } |
| 28 | + run: time coverage run -m backtesting.test |
| 29 | + - run: coverage combine && coverage report |
| 30 | + |
8 | 31 | build:
|
9 |
| - name: Build |
| 32 | + needs: lint |
10 | 33 | runs-on: ubuntu-latest
|
| 34 | + timeout-minutes: 3 |
11 | 35 | strategy:
|
12 | 36 | matrix:
|
13 |
| - python-version: ['3.10', 3.13] |
14 |
| - include: |
15 |
| - - python-version: 3.12 |
16 |
| - test-type: lint |
17 |
| - - python-version: 3.11 |
18 |
| - test-type: docs |
19 |
| - |
| 37 | + python-version: [3.11, 3.12, 3.13] |
20 | 38 | steps:
|
21 | 39 | - uses: actions/setup-python@v5
|
22 | 40 | with:
|
23 | 41 | python-version: ${{ matrix.python-version }}
|
24 |
| - - uses: actions/cache@v4 |
25 |
| - with: |
26 |
| - path: ~/.cache/pip |
27 |
| - key: ${{ runner.os }}-py${{ matrix.python-version }} |
28 | 42 | - uses: actions/checkout@v4
|
29 |
| - with: |
30 |
| - fetch-depth: 3 |
31 |
| - - name: Fetch tags |
32 |
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
33 |
| - |
34 |
| - - run: pip install -U pip setuptools wheel |
35 |
| - - if: matrix.test-type == 'lint' |
36 |
| - run: pip install -U --pre bokeh pandas numpy && pip install -U .[dev] |
37 |
| - - if: matrix.test-type == 'docs' |
38 |
| - run: pip install -e .[doc] # -e provides _version.py for pdoc |
39 | 43 | - run: pip install -U .[test]
|
40 |
| - |
41 |
| - - if: matrix.test-type == 'lint' |
42 |
| - run: flake8 backtesting setup.py |
43 |
| - - if: matrix.test-type == 'lint' |
44 |
| - run: mypy backtesting |
45 |
| - - if: matrix.test-type == 'lint' |
46 |
| - env: { BOKEH_BROWSER: none } |
47 |
| - run: time coverage run -m backtesting.test |
48 |
| - - if: matrix.test-type == 'lint' |
49 |
| - run: coverage combine && coverage report |
50 |
| - |
51 |
| - - if: '! matrix.test-type' |
52 |
| - env: { BOKEH_BROWSER: none } |
| 44 | + - env: { BOKEH_BROWSER: none } |
53 | 45 | run: time python -m backtesting.test
|
54 | 46 |
|
55 |
| - - if: matrix.test-type == 'docs' |
56 |
| - run: time doc/build.sh |
| 47 | + docs: |
| 48 | + needs: lint |
| 49 | + runs-on: ubuntu-latest |
| 50 | + timeout-minutes: 3 |
| 51 | + steps: |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + with: |
| 54 | + fetch-depth: 3 |
| 55 | + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
| 56 | + - run: pip install -e .[doc,test] # -e provides ./backtesting/_version.py for pdoc |
| 57 | + - run: time doc/build.sh |
| 58 | + |
| 59 | + win64: |
| 60 | + needs: |
| 61 | + - build |
| 62 | + - docs |
| 63 | + runs-on: windows-latest |
| 64 | + timeout-minutes: 4 |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v4 |
| 67 | + - uses: actions/setup-python@v5 |
| 68 | + with: |
| 69 | + python-version: 3.13 |
| 70 | + - run: pip install .[test] |
| 71 | + - env: { BOKEH_BROWSER: none } |
| 72 | + run: python -m backtesting.test |
0 commit comments