Skip to content

Commit

Permalink
CI: Update CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Jan 21, 2025
1 parent be5423d commit 0ce6cab
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, '3.10']
python-version: ['3.10', 3.13]
include:
- python-version: 3.9
- python-version: 3.11
test-type: lint
- python-version: 3.9
- python-version: 3.11
test-type: docs

steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}
- uses: actions/checkout@v3
- 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<1.24' && pip install -U .[dev]
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]
Expand All @@ -44,13 +44,13 @@ jobs:
run: mypy backtesting
- if: matrix.test-type == 'lint'
env: { BOKEH_BROWSER: none }
run: time catchsegv coverage run -m backtesting.test
run: time coverage run -m backtesting.test
- if: matrix.test-type == 'lint'
run: coverage report
run: coverage combine && coverage report

- if: '! matrix.test-type'
env: { BOKEH_BROWSER: none }
run: time catchsegv python -m backtesting.test
run: time python -m backtesting.test

- if: matrix.test-type == 'docs'
run: time catchsegv doc/build.sh
run: time doc/build.sh
23 changes: 8 additions & 15 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.11

- uses: actions/cache@v2
name: Set up caches
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}

- name: Checkout repo
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 3
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U -e .[doc,test]
- run: pip install -U pip setuptools wheel
- run: pip install -U -e .[doc,test]

- name: Build docs
run: time catchsegv doc/build.sh
- run: time doc/build.sh

- name: Deploy docs
- run: .github/deploy-gh-pages.sh
env:
GH_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: .github/deploy-gh-pages.sh
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ignore_missing_imports = True

[coverage:run]
parallel = 1
concurrency =
multiprocessing
concurrency = multiprocessing,thread
disable_warnings = no-data-collected
source =
backtesting
doc/examples
Expand Down

0 comments on commit 0ce6cab

Please sign in to comment.