-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 1.73 KB
/
test.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
name: Test
on:
push:
branches-ignore:
- main
- renovate/configure
paths-ignore:
- CHANGELOG.md
- README.md
- CONTRIBUTING.md
- renovate.json
- ".github/workflows/**"
- .releaserc.yml
- "package*.json"
workflow_call:
secrets:
CODECOV_TOKEN:
description: "Codecov token"
required: true
SONAR_TOKEN:
description: "Sonar token"
required: true
jobs:
test:
name: Build and test
runs-on: ubuntu-22.04
env:
TERM: dumb
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup scala environment
uses: olafurpg/setup-scala@v14
with:
java-version: openjdk@1.17
- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- name: Lint with scalafmt
run: sbt scalafmtCheckAll
- name: Check with scalafix
run: sbt 'scalafixAll --check'
- name: Test
run: sbt clean coverage test coverageReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: target/scala-3.3.0/scoverage-report
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
verbose: true
- name: SonarCloud scan fixed
uses: pervasive-cats/sonarcloud-scoverage-fix@v1.0.1
with:
scoverageReport: target/scala-3.3.0/scoverage-report/scoverage.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}