-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (73 loc) · 2.62 KB
/
ci.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch: {}
jobs:
core:
name: Reflect scala_versions
runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '1.14' ]
scala: [
{ version: '2.12.18', bincompat: '2.12' }
]
outputs:
scala_versions: ${{ steps.set-scala-versions.outputs.scala_versions }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v14
with:
java-version: zulu@${{ matrix.java }}
- name: Set scala version for matrix
id: set-scala-versions # The greps on the following line are to ensure as much as possible that we've caught the right line
run: echo "scala_versions=$(sbt 'print githubMatrixSettings' | grep '^\[{' | grep 'bincompat' | tail -n 1)" >> $GITHUB_OUTPUT
scala:
runs-on: ubuntu-20.04
needs: [core]
strategy:
matrix:
java: [ '1.14', '1.17' ]
scala: ${{ fromJson(needs.core.outputs.scala_versions) }}
framework: [
{ framework: 'pekko-http', project: 'sample-pekkoHttp' },
]
steps:
- run: echo 'combo_enabled=true' >> $GITHUB_ENV
- run: echo 'combo_enabled=false' >> $GITHUB_ENV
if: ${{ matrix.java == '1.17' && matrix.scala.bincompat == '2.12' }}
- run: echo 'combo_enabled=false' >> $GITHUB_ENV
if: matrix.scala.bincompat == '2.13' && matrix.framework.framework == 'dropwizard'
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v14
with:
java-version: zulu@${{ matrix.java }}
- name: print Java version
run: java -version
- uses: actions/cache@v3
with:
path: ~/.cache/coursier
key: ${{ runner.os }}-scala-${{ matrix.scala.version }}-${{ hashFiles('**/*.sbt') }}
restore-keys: |
${{ runner.os }}-scala-${{ matrix.scala.version }}-
- name: Compile in lieu of test suite (TODO)
if: ${{ env.combo_enabled == 'true' }}
run: sbt ++${{ matrix.scala.version }} clean compile
# - name: Run tests
# if: ${{ env.combo_enabled == 'true' }}
# run: sbt ++${{ matrix.scala.version }} clean coverage "runExample scala ${{ matrix.framework.framework }}" ${{ matrix.framework.project }}/test coverageAggregate
# - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # 3.1.4
# if: ${{ env.combo_enabled == 'true' }}
# with:
# file: ./target/scala-${{ matrix.scala.bincompat }}/scoverage-report/scoverage.xml
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}