Skip to content

feat(risk): add apply_risk_gate to all crypto entrypoints (#63) #165

feat(risk): add apply_risk_gate to all crypto entrypoints (#63)

feat(risk): add apply_risk_gate to all crypto entrypoints (#63) #165

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Actionlint
uses: docker://rhysd/actionlint:1.7.12
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check whitespace
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch --no-tags --depth=1 origin "${{ github.base_ref }}"
git diff --check "origin/${{ github.base_ref }}...HEAD"
else
git diff-tree --check --no-commit-id --root -r HEAD
fi
- name: Resolve QuantPlatformKit ref
id: quant-platform-kit-ref
run: |
set -euo pipefail
ref="main"
if [ -n "${GITHUB_HEAD_REF:-}" ] && git ls-remote --exit-code --heads https://github.com/QuantStrategyLab/QuantPlatformKit.git "${GITHUB_HEAD_REF}" >/dev/null 2>&1; then
ref="${GITHUB_HEAD_REF}"
fi
echo "ref=${ref}" >> "$GITHUB_OUTPUT"
- name: Checkout QuantPlatformKit
uses: actions/checkout@v6
with:
repository: QuantStrategyLab/QuantPlatformKit
ref: ${{ steps.quant-platform-kit-ref.outputs.ref }}
path: external/QuantPlatformKit
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
set -euo pipefail
python -m pip install --upgrade pip
python -m pip install -e . numpy pandas pytest pytest-cov ruff build
python -m pip install --no-deps -e external/QuantPlatformKit
- name: Verify dependencies
run: |
set -euo pipefail
python -m pip check
- name: Run Ruff
run: |
set -euo pipefail
ruff check .
- name: Run unit tests
run: |
set -euo pipefail
python -m pytest -q tests --cov --cov-report=term --cov-report=xml
- name: Build package
run: |
set -euo pipefail
python -m build