-
-
Notifications
You must be signed in to change notification settings - Fork 66
172 lines (170 loc) · 5.86 KB
/
build.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Build
on:
workflow_dispatch:
inputs: {}
push:
branches: [ "develop" ]
tags: [ "v**" ]
pull_request:
branches: [ "develop" ]
jobs:
checksecret:
runs-on: ubuntu-latest
outputs:
HAVE_SECRETS: ${{ steps.checksecret_job.outputs.HAVE_SECRETS }}
steps:
- id: checksecret_job
env:
TOKEN_BITWARDEN_SM: ${{ secrets.TOKEN_BITWARDEN_SM }}
run: |
echo "HAVE_SECRETS=${{ env.TOKEN_BITWARDEN_SM != '' }}" >> $GITHUB_OUTPUT
build-jvm:
runs-on: ubuntu-latest
needs: [ 'checksecret' ]
strategy:
matrix:
java: [ '11', '17' ]
scala: [ '2.12', '2.13', '3' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- name: Build and Test with Coverage
if: matrix.scala != '3'
run: |
bash sbtgen.sc
bash .build.sh ${{ matrix.scala }} coverage
- name: Build and Test without Coverage # coverage leads to verification errors on scala3
if: matrix.scala == '3'
run: |
bash sbtgen.sc
bash .build.sh ${{ matrix.scala }} test
- uses: dorny/test-reporter@v1
if: (needs.checksecret.outputs.HAVE_SECRETS == 'true') && (success() || failure())
# continue-on-error: ${{ matrix.scala == '3' }}
with:
name: Test reports (JDK ${{ matrix.java }}, Scala ${{ matrix.scala }}, JVM)
path: '**/target/test-reports/TEST-*.xml'
reporter: java-junit
# fail-on-error: ${{ matrix.scala != '3' }}
- uses: bitwarden/sm-action@v2
if: (needs.checksecret.outputs.HAVE_SECRETS == 'true') && (success() || failure())
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
5e21669e-48b4-49ce-82f0-b193010a2ded > TOKEN_CODECOV
- uses: codecov/codecov-action@v4
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
continue-on-error: true
with:
token: ${{ env.TOKEN_CODECOV }}
verbose: true # optional (default = false)
# fail_ci_if_error: ${{ matrix.scala != '3' }}
files: "**/cobertura.xml"
# TODO: do we need scoverage.xml? If so files: may be just omitted
# files: cobertura.xml,scoverage.xml
# flags: unittests
- name: Upload dependency graph
uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91
if: github.ref == 'develop'
build-js:
runs-on: ubuntu-latest
needs: [ 'checksecret' ]
strategy:
matrix:
java: [ '11', '17' ]
scala: [ '2.12', '2.13', '3' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- name: Build and Test with Coverage
if: matrix.scala != '3'
run: |
bash sbtgen.sc --nojvm --js
bash .build.sh ${{ matrix.scala }} coverage
- name: Build and Test without Coverage # coverage leads to verification errors on scala3
if: matrix.scala == '3'
run: |
bash sbtgen.sc --nojvm --js
bash .build.sh ${{ matrix.scala }} test
- uses: dorny/test-reporter@v1
if: (needs.checksecret.outputs.HAVE_SECRETS == 'true') && (success() || failure())
# continue-on-error: ${{ matrix.scala == '3' }}
with:
name: Test reports (JDK ${{ matrix.java }}, Scala ${{ matrix.scala }}, JS)
path: '**/target/test-reports/TEST-*.xml'
reporter: java-junit
# fail-on-error: ${{ matrix.scala != '3' }}
test-site:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' ]
scala: [ '2.13']
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- name: Build Microsite
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} site-test
publish-site:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' ]
scala: [ '2.13']
needs: [ 'build-jvm', 'build-js', 'test-site', 'checksecret' ]
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
4aeac969-5880-4e36-97a8-b193010ca904 > IZUMI_MICROSITE_KEY
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ env.IZUMI_MICROSITE_KEY }}
known_hosts: 'unnecessary' # github.com is already there
- name: Publish Microsite
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} site-publish
publish-artifacts:
runs-on: ubuntu-latest
needs: [ 'build-jvm', 'build-js', 'checksecret' ]
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
strategy:
matrix:
java: [ '11' ]
scala: [ '2.12', '2.13', '3']
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
994f97a2-97a4-4fe1-806a-b1930104435f > SONATYPE_CREDENTIALS_FILE
749f4227-9f11-4ceb-9121-b1930110c3a9 > OPENSSL_KEY
a2fe5b5b-5f3f-47f8-961c-b1930110cea7 > OPENSSL_IV
- name: Build and Publish to Sonatype
# continue-on-error: ${{ matrix.scala == '3' }}
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} secrets publishScala
all-good:
if: always()
runs-on: ubuntu-latest
needs: [ 'build-jvm', 'build-js', 'test-site' ]
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}