Repository navigation
49 lines (46 loc) · 1.63 KB
/
Copy pathtest-typescript.yml
File metadata and controls
49 lines (46 loc) · 1.63 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
46
47
48
49
name: TypeScript
on:
workflow_call:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: Build (Node ${{ matrix.node-version }})
strategy:
matrix:
node-version: ['22', '24', '26']
timeout-minutes: 5
defaults:
run:
working-directory: typescript
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" typescript .'
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: typescript/package-lock.json
- run: npm ci
- name: Build template
run: npm run build
- name: Test template portfolio scenario
run: npx vitest run tests/optimalPortfolioScenario.test.ts
- name: Apply interview patch
run: '"${GITHUB_WORKSPACE}/scripts/apply-interview-patch.sh" typescript .'
- name: Build assembled interview
run: npm run build
- name: Test assembled portfolio scenario
run: npx vitest run tests/optimalPortfolioScenario.test.ts
- name: Order scenario test should fail at the rebalance assertion
run: |
"${GITHUB_WORKSPACE}/.github/scripts/expect-order-scenario-failure.sh" \
npx vitest run tests/orderScenario.test.ts
env:
EXPECTED_FAILURE: 'asset3 Toyopa amount: got 20000, want 19000'