Repository navigation
48 lines (45 loc) · 1.67 KB
/
Copy pathtest-ruby.yml
File metadata and controls
48 lines (45 loc) · 1.67 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
name: Ruby
on:
workflow_call:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: Build (Ruby ${{ matrix.ruby-version }})
timeout-minutes: 5
strategy:
matrix:
ruby-version: ['3.2', '3.3', '3.4', '4.0']
defaults:
run:
working-directory: ruby
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" ruby .'
- uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
working-directory: ruby
- name: Compile template
run: find lib -name '*.rb' -exec ruby -c {} +
- name: Test template portfolio scenario
run: bundle exec rspec spec/optimal_portfolio_scenario_spec.rb
- name: Apply interview patch
run: '"${GITHUB_WORKSPACE}/scripts/apply-interview-patch.sh" ruby .'
- name: Compile assembled interview
run: find lib -name '*.rb' -exec ruby -c {} +
- name: Test assembled portfolio scenario
run: bundle exec rspec spec/optimal_portfolio_scenario_spec.rb
- name: Order scenario test should fail at the rebalance assertion
run: |
"${GITHUB_WORKSPACE}/.github/scripts/expect-order-scenario-failure.sh" \
bundle exec rspec spec/order_scenario_spec.rb
env:
EXPECTED_FAILURE: 'expect(BigDecimal(asset3_toyopa.amount_jpy)).to eq(BigDecimal("19000"))'