Repository navigation
49 lines (46 loc) · 1.65 KB
/
Copy pathtest-scala.yml
File metadata and controls
49 lines (46 loc) · 1.65 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: Scala
on:
workflow_call:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: Build (Java ${{ matrix.java-version }})
strategy:
matrix:
java-version: ['8', '11', '17', '21']
timeout-minutes: 5
defaults:
run:
working-directory: scala
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
cache: sbt
- uses: sbt/setup-sbt@b113b960ba361e87e08ce02a390d51871b7ee459 # v1.5.13
- name: Verify interview template and patch
run: '"${GITHUB_WORKSPACE}/scripts/verify-interview-patch.sh" scala .'
- name: Compile template
run: sbt compile
- name: Test template portfolio scenario
run: sbt "testOnly folio.codinginterview.OptimalPortfolioScenario"
- name: Apply interview patch
run: '"${GITHUB_WORKSPACE}/scripts/apply-interview-patch.sh" scala .'
- name: Compile assembled interview
run: sbt compile
- name: Test assembled portfolio scenario
run: sbt "testOnly folio.codinginterview.OptimalPortfolioScenario"
- name: Order scenario test should fail at the rebalance assertion
run: |
"${GITHUB_WORKSPACE}/.github/scripts/expect-order-scenario-failure.sh" \
sbt "testOnly folio.codinginterview.OrderScenario"
env:
EXPECTED_FAILURE: 'Expected 19000, but got 20000'