-
-
Notifications
You must be signed in to change notification settings - Fork 4
96 lines (84 loc) · 2.71 KB
/
cicd.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
name: CICD
# triggers
on:
push:
branches: ['*']
release:
types: [ created ]
pull_request:
branches:
- main
# jobs
jobs:
build:
name: build (${{ matrix.name }})
runs-on: ubuntu-latest
strategy:
matrix:
# supported scala versions
include:
- scala: 2.13.14
name: Scala2_13
test-tasks: coverage test coverageReport gen-doc
- scala: 3.3.3
name: Scala3_3
test-tasks: coverage test coverageReport
steps:
- uses: actions/checkout@v4
#----------- JDK -----------
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: "liberica"
java-version: 17
#----------- CACHE -----------
- name: Cache SBT
uses: actions/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
~/.ivy2/cache
~/.sbt
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-sbt-${{ matrix.scala }}-${{ hashFiles('**/build.sb') }}
#----------- COMPILE -----------
- name: Compile, Format, Test and Coverage for ${{ matrix.scala }}
run: sbt ++${{ matrix.scala }} clean scalafmtCheck ${{ matrix.test-tasks }}
#----------- MIMA -----------
- name: MiMa Report
run: sbt ++${{ matrix.scala }} mimaReportBinaryIssues
#----------- COVERAGE -----------
- name: Upload Coverage to Codacy
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs: [build]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
#----------- JDK -----------
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: "liberica"
java-version: 17
#----------- CACHE -----------
- name: Cache SBT
uses: actions/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
~/.ivy2/cache
~/.sbt
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-sbt-${{ matrix.scala }}-${{ hashFiles('**/build.sb') }}
#----------- RELEASE -----------
- name: Release
run: sbt clean compile ci-release
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}