-
Notifications
You must be signed in to change notification settings - Fork 0
223 lines (221 loc) · 8.11 KB
/
ci.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: CI
on:
pull_request:
push:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
java: 17
distribution: temurin
jobtype: 1
- os: ubuntu-latest
java: 11
distribution: temurin
jobtype: 2
- os: ubuntu-latest
java: 11
distribution: temurin
jobtype: 3
- os: ubuntu-latest
java: 11
distribution: temurin
jobtype: 4
- os: ubuntu-latest
java: 17
distribution: temurin
jobtype: 5
- os: ubuntu-latest
java: 8
distribution: adopt
jobtype: 6
- os: ubuntu-latest
java: 8
distribution: adopt
jobtype: 7
- os: macos-latest
java: 8
distribution: adopt
jobtype: 8
- os: windows-2019
java: 8
distribution: adopt
jobtype: 9
runs-on: ${{ matrix.os }}
env:
JAVA_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
JVM_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
SCALA_212: 2.12.17
SCALA_213: 2.13.8
SCALA_3: 3.1.0
UTIL_TESTS: "utilCache/test utilControl/test utilInterface/test utilLogging/test utilPosition/test utilRelation/test utilScripted/test utilTracking/test"
SBT_LOCAL: false
TEST_SBT_VER: 1.5.0
SBT_ETC_FILE: $HOME/etc/sbt/sbtopts
JDK11: adopt@1.11.0-9
SPARK_LOCAL_IP: "127.0.0.1"
steps:
- name: Checkout sbt/sbt
uses: actions/checkout@v3
- name: Checkout sbt/io
uses: actions/checkout@v3
with:
repository: sbt/io
ref: develop
path: io
- name: Checkout sbt/librarymanagement
uses: actions/checkout@v3
with:
repository: sbt/librarymanagement
ref: develop
path: librarymanagement
- name: Checkout sbt/zinc
uses: actions/checkout@v3
with:
repository: sbt/zinc
ref: develop
path: zinc
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: "${{ matrix.distribution }}"
java-version: "${{ matrix.java }}"
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Coursier cache
uses: coursier/cache-action@v6
# - name: Cache sbt
# uses: actions/cache@v3
# with:
# path: ~/.sbt
# key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Setup Windows C++ toolchain
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-2019' }}
- name: Pre-test cleanup
shell: bash
run: |
rm -rf "$HOME/.sbt/scripted/" || true
rm -rf "$HOME/.ivy2/local" || true
rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
- name: Build and test (1)
if: ${{ matrix.jobtype == 1 }}
shell: bash
run: |
rm -rf "$HOME/.sbt/boot/" || true
# ./sbt -v --client mimaReportBinaryIssues
./sbt -v --client javafmtCheck
./sbt -v --client "Test/javafmtCheck"
./sbt -v --client scalafmtCheckAll
./sbt -v --client scalafmtSbtCheck
./sbt -v --client serverTestProj/scalafmtCheckAll
# ./sbt -v --client headerCheck
# ./sbt -v --client "Test/headerCheck"
./sbt -v --client "Test/compile"
./sbt -v --client publishLocal
./sbt -v --client test
# ./sbt -v --client "serverTestProj/test"
# ./sbt -v --client doc
./sbt -v --client "all $UTIL_TESTS"
./sbt -v --client ++$SCALA_213
./sbt -v --client "all $UTIL_TESTS"
./sbt -v --client ++$SCALA_212
./sbt -v --client "all $UTIL_TESTS"
- name: Build and test (2)
if: ${{ matrix.jobtype == 2 }}
shell: bash
run: |
./sbt -v "scripted actions/* apiinfo/* compiler-project/* ivy-deps-management/* reporter/* tests/* classloader-cache/* package/*"
# ./sbt -v "scripted watch/*"
- name: Build and test (3)
if: ${{ matrix.jobtype == 3 }}
shell: bash
run: |
# ./sbt -v "dependencyTreeProj/publishLocal; scripted dependency-graph/*"
./sbt -v --client "scripted dependency-management/* project-load/* java/* run/*"
# ./sbt -v --client "scripted plugins/*"
# ./sbt -v --client "scripted nio/*"
- name: Build and test (4)
if: ${{ matrix.jobtype == 4 }}
shell: bash
run: |
# ./sbt -v "repoOverrideTest:scripted dependency-management/*"
./sbt -v "scripted source-dependencies/*"
# ./sbt -v "scripted project/*"
- name: Build and test (5)
if: ${{ matrix.jobtype == 5 }}
shell: bash
run: |
./sbt -v --client test
./sbt -v --client "++$SCALA_213; all $UTIL_TESTS"
./sbt -v --client "++$SCALA_212; all $UTIL_TESTS"
# - name: Build and test (6)
# if: ${{ matrix.jobtype == 6 }}
# shell: bash
# run: |
# # build from fresh IO, LM, and Zinc
# BUILD_VERSION="1.5.0-SNAPSHOT"
# cd io
# sbt -v -Dsbt.build.version=${BUILD_VERSION} +publishLocal
# cd ../
# sbt -Dsbtlm.path=$HOME/work/sbt/sbt/librarymanagement -Dsbtzinc.path=$HOME/work/sbt/sbt/zinc -Dsbt.build.version=$BUILD_VERSION -Dsbt.build.fatal=false "+lowerUtils/publishLocal; {librarymanagement}/publishLocal; {zinc}/publishLocal; upperModules/publishLocal"
# rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
# sbt -v -Dsbt.version=$BUILD_VERSION "++$SCALA_213; all $UTIL_TESTS; ++$SCALA_212; all $UTIL_TESTS; scripted actions/* source-dependencies/*1of3 dependency-management/*1of4 java/*"
- name: Build and test (7)
if: ${{ matrix.jobtype == 7 }}
shell: bash
run: |
# test building sbtn on Linux
sbt "-Dsbt.io.virtual=false" nativeImage
# test launcher script
echo build using JDK 8 test using JDK 8 and JDK 11
cd launcher-package
sbt -Dsbt.build.version=$TEST_SBT_VER rpm:packageBin debian:packageBin
sbt -Dsbt.build.version=$TEST_SBT_VER universal:packageBin universal:stage integrationTest/test
cd citest && ./test.sh
$HOME/bin/jabba install $JDK11 && exec $HOME/bin/jabba which --home $JDK11
java -Xmx32m -version
./test.sh
- name: Build and test (8)
if: ${{ matrix.jobtype == 8 }}
shell: bash
run: |
# test building sbtn on macOS
sbt "-Dsbt.io.virtual=false" nativeImage
# test launcher script
echo build using JDK 8, test using JDK 8, on macOS
cd launcher-package
bin/coursier resolve
sbt -Dsbt.build.version=$TEST_SBT_VER universal:packageBin universal:stage integrationTest/test
cd citest && ./test.sh
- name: Build and test (9)
if: ${{ matrix.jobtype == 9 }}
shell: bash
run: |
# test building sbtn on Windows
sbt "-Dsbt.io.virtual=false" nativeImage
# test launcher script
echo build using JDK 8, test using JDK 8, on Windows
cd launcher-package
bin/coursier.bat resolve
sbt -Dsbt.build.version=$TEST_SBT_VER universal:packageBin universal:stage integrationTest/test
cd citest
./test.bat
test3/test3.bat
- name: Cleanup
shell: bash
run: |
rm -rf "$HOME/.sbt/scripted/" || true
rm -rf "$HOME/.ivy2/local" || true
rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true