Repository navigation
45 lines (42 loc) · 1.57 KB
/
Copy pathtest-python.yml
File metadata and controls
45 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Python
on:
workflow_call:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: Build
timeout-minutes: 5
defaults:
run:
working-directory: python
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Verify interview template and patch
run: '"${GITHUB_WORKSPACE}/scripts/verify-interview-patch.sh" python .'
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: 'python/pyproject.toml'
cache: pip
- run: pip install -e ".[dev]"
- name: Compile template
run: find src -name '*.py' -exec python -m py_compile {} +
- name: Test template portfolio scenario
run: python -m pytest tests/test_optimal_portfolio_scenario.py
- name: Apply interview patch
run: '"${GITHUB_WORKSPACE}/scripts/apply-interview-patch.sh" python .'
- name: Compile assembled interview
run: find src -name '*.py' -exec python -m py_compile {} +
- name: Test assembled portfolio scenario
run: python -m pytest tests/test_optimal_portfolio_scenario.py
- name: Order scenario test should fail at the rebalance assertion
run: |
"${GITHUB_WORKSPACE}/.github/scripts/expect-order-scenario-failure.sh" \
python -m pytest tests/test_order_scenario.py
env:
EXPECTED_FAILURE: "assert Decimal('20000') == Decimal('19000')"