Skip to content

Fix RiskEngine cumulative notional check #1544

Fix RiskEngine cumulative notional check

Fix RiskEngine cumulative notional check #1544

Workflow file for this run

name: coverage
# Run code coverage analysis for NautilusTrader
on:
push:
branches: [develop]
jobs:
build:
strategy:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-latest]
python-version: ["3.10"]
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get Rust version from rust-toolchain.toml
id: rust-version
run: |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml)
echo "Rust toolchain version $version"
echo "RUST_VERSION=$version" >> $GITHUB_ENV
working-directory: ${{ github.workspace }}
- name: Set up Rust tool-chain (Linux, Windows) stable
if: (runner.os == 'Linux') || (runner.os == 'Windows')
uses: actions-rust-lang/[email protected]
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get Poetry version from poetry-version
run: |
version=$(cat poetry-version)
echo "POETRY_VERSION=$version" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec
- name: Setup cached pre-commit
id: cached-pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --all-files
- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV
- name: Poetry cache
id: cached-poetry
uses: actions/cache@v3
with:
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
- name: Install Redis
run: |
sudo apt-get install redis-server
redis-server --daemonize yes
- name: Run tests with coverage
run: make pytest-coverage
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true