-
Notifications
You must be signed in to change notification settings - Fork 23
142 lines (122 loc) · 3.48 KB
/
continuous-integration.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
136
137
138
139
140
141
142
# Continuous Integration (CI) to Build & Test & Coverage & Lint.
# ~~
name: CI
on:
pull_request:
branches: [ master, '**' ]
push:
branches: [ master ]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
validate:
name: Validate Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: '11'
cache: 'sbt'
- name: Set up Scala and sbt
uses: olafurpg/setup-scala@v14
with:
java-version: '11'
# scala-version: '2.13.10'
sbt-version: '1.8.2'
- name: Validate Code
run: sbt validateCode
build:
name: Build & Test
needs: [ validate ]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
scala: [ '2.12.18', '2.13.11', '3.2.2']
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '11'
cache: 'sbt'
- name: Set up Scala and sbt
uses: olafurpg/setup-scala@v14
with:
java-version: '11'
# scala-version: '2.13.10'
sbt-version: '1.8.2'
- name: Build & Test
run: sbt ++${{ matrix.scala }} clean testWithCoverage
- name: Upload coverage report (all)
uses: actions/[email protected]
with:
name: coverage-report-${{ matrix.scala }}
path: ${{github.workspace}}/target/scala-${{ matrix.scala }}/coverage-report
optional-build:
name: Build (Optional)
continue-on-error: ${{ matrix.experimental }}
needs: [ validate ]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
distribution: [ 'corretto' ]
jdk: [ '11' ]
scala: [ '2.12.18', '2.13.11', '3.2.2']
experimental: [ false ]
include:
- jdk: '17'
distribution: 'corretto'
scala: '2.13.11'
experimental: true
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.jdk }}
cache: 'sbt'
- name: Set up Scala and sbt
uses: olafurpg/setup-scala@v14
with:
java-version: ${{ matrix.jdk }}
# scala-version: '2.13.10'
sbt-version: '1.8.2'
- name: Perform Build / Test
run: sbt ++${{ matrix.scala }} clean compile test
# coverage:
# name: Coverage Report
# if: ${{ github.event.pull_request }}
# needs: [ build ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: cobertura.xml
#
# - name: Analyzing coverage report
# uses: 5monkeys/cobertura-action@master
# with:
# path: cobertura.xml
# only_changed_files: true
# fail_below_threshold: true
# show_missing: true
# show_line: true
# show_branch: true
# show_class_names: true
# link_missing_lines: true
# minimum_coverage: 75
ready-to-merge:
name: Ready to Merge
if: ${{ github.event.pull_request }}
needs: [ optional-build ]
runs-on: ubuntu-latest
steps:
- run: echo 'Ready to merge.'