-
Notifications
You must be signed in to change notification settings - Fork 133
135 lines (133 loc) · 5.18 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch: {}
jobs:
core:
name: Run core tests
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
- 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: Bump version
run: support/apply-pr-label-locally.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: sbt ++${{ matrix.scala.version }} 'show stableVersion' clean samples/clean checkFormatting coverage test coverageAggregate versionPolicyCheck microsite/compile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GUARDRAIL_CI: true
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # 3.1.4
with:
file: ./target/scala-${{ matrix.scala.bincompat }}/scoverage-report/scoverage.xml
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
java:
runs-on: ubuntu-20.04
needs: [core]
strategy:
matrix:
java: [ '1.14', '1.17' ]
scala: [
{ version: '2.12.16', bincompat: '2.12' }
]
framework: [
{ framework: 'dropwizard', project: 'sample-dropwizard' },
{ framework: 'dropwizard-vavr', project: 'sample-dropwizardVavr' },
{ framework: 'spring-mvc', project: 'sample-springMvc' }
]
steps:
- 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: Run tests
run: sbt ++${{ matrix.scala.version }} clean samples/clean coverage "runExample java ${{ matrix.framework.framework }}" ${{ matrix.framework.project }}/test coverageAggregate
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # 3.1.4
with:
file: ./target/scala-${{ matrix.scala.bincompat }}/scoverage-report/scoverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
scala:
runs-on: ubuntu-20.04
needs: [core]
strategy:
matrix:
java: [ '1.14', '1.17' ]
scala: ${{ fromJson(needs.core.outputs.scala_versions) }}
framework: [
{ framework: 'akka-http', project: 'sample-akkaHttp' },
{ framework: 'http4s', project: 'sample-http4s' },
{ framework: 'http4s-v0.22', project: 'sample-http4s-v0_22' },
{ framework: 'akka-http-jackson', project: 'sample-akkaHttpJackson' },
{ framework: 'dropwizard', project: 'sample-dropwizardScala' }
]
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: Run tests
if: ${{ env.combo_enabled == 'true' }}
run: sbt ++${{ matrix.scala.version }} clean samples/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 }}