-
Notifications
You must be signed in to change notification settings - Fork 2
183 lines (153 loc) · 5.57 KB
/
scala.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
173
174
175
176
177
178
179
180
181
182
183
name: Scala CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
compile_scala_212:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
# Caching dependencies in Pull Requests based on branch name and build.sbt.
# Can we do something better here?
- name: Cache Coursier dependencies
uses: actions/cache@v3
env:
cache-name: coursier-cache
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Cache Ivy 2 cache
uses: actions/cache@v3
env:
cache-name: sbt-ivy2-cache
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Compile
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx2G -J-XX:+UseG1GC ++2.12 Test/compile
compile_scala_213:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
# Caching dependencies in Pull Requests based on branch name and build.sbt.
# Can we do something better here?
- name: Cache Coursier dependencies
uses: actions/cache@v3
env:
cache-name: coursier-cache
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Cache Ivy 2 cache
uses: actions/cache@v3
env:
cache-name: sbt-ivy2-cache
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Compile
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx2G -J-XX:+UseG1GC ++2.13 Test/compile
test:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
# Caching dependencies in Pull Requests based on branch name and build.sbt.
# Can we do something better here?
- name: Cache Coursier dependencies
uses: actions/cache@v3
env:
cache-name: coursier-cache
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Cache Ivy 2 cache
uses: actions/cache@v3
env:
cache-name: sbt-ivy2-cache
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.head_ref }}-${{ hashFiles('**/build.sbt') }}
- name: Run tests
env:
COGNITE_BASE_URL: "https://bluefield.cognitedata.com"
TEST_AAD_TENANT: "b86328db-09aa-4f0e-9a03-0136f604d20a"
TEST_CLIENT_ID: ${{ secrets.BLUEFIELD_CLIENT_ID }}
TEST_CLIENT_SECRET: ${{ secrets.BLUEFIELD_CLIENT_SECRET }}
TEST_PROJECT: "extractor-bluefield-testing"
COGNITE_BASE_URL2: "https://api.cognitedata.com"
TEST_AAD_TENANT2: "b86328db-09aa-4f0e-9a03-0136f604d20a"
TEST_CLIENT_ID2: ${{ secrets.BLUEFIELD_CLIENT_ID }}
TEST_CLIENT_SECRET2: ${{ secrets.BLUEFIELD_CLIENT_SECRET }}
TEST_PROJECT2: "playground"
# run: sbt test
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx2G -J-XX:+UseG1GC ++2.13 scalastyle test:scalastyle scalafmtCheck coverage test coverageReport
- name: Upload test coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.codecov_token }}
publish:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
git rev-list --count --first-parent HEAD > patch_version.txt
- name: Set up JDK 8
uses: coursier/setup-action@v1
with:
jvm: adopt:8
- name: Set up SBT
env:
SECRETS_KEY: ${{ secrets.secrets_key }}
run: |
mkdir -p ~/.sbt/1.0
secrets/decrypt.sh secrets/credentials.sbt.gpg ~/.sbt/1.0/credentials.sbt
secrets/decrypt.sh secrets/repositories.gpg ~/.sbt/1.0/repositories
mkdir -p ~/.sbt/gpg
secrets/decrypt.sh secrets/pubring.asc.gpg ~/.sbt/gpg/pubring.asc
secrets/decrypt.sh secrets/secring.asc.gpg ~/.sbt/gpg/secring.asc
- name: Build JAR file
run: |
cat /dev/null | sbt -Dsbt.log.noformat=true -J-Xmx3G -J-XX:+UseG1GC "set Test/test := {}" "set compile/skip := true" +package
- name: Publish package
env:
GPG_KEY_PASSWORD: ${{ secrets.gpg_key_password }}
run: |
sbt -Dsbt.log.noformat=true -J-Xmx3G -J-XX:+UseG1GC +publishSigned +sonatypeReleaseAll