This repository was archived by the owner on Apr 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
81 lines (80 loc) · 2.74 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
name: CI
on:
pull_request:
push:
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
java: 8
jobtype: 1
- os: macos-latest
java: 8
jobtype: 2
- os: windows-latest
java: 8
jobtype: 3
runs-on: ${{ matrix.os }}
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
SBT_VER: 1.4.2
SBT_ETC_FILE: $HOME/etc/sbt/sbtopts
JDK11: [email protected]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup
uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.${{ matrix.java }}"
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Coursier cache
uses: coursier/cache-action@v5
- name: Cache sbt
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Build and test
shell: bash
run: |
case ${{ matrix.jobtype }} in
1)
echo build using JDK 8 test using JDK 8 and JDK 11
sbt -Dsbt.build.version=$SBT_VER rpm:packageBin debian:packageBin
sbt -Dsbt.build.version=$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
;;
2)
echo build using JDK 8, test using JDK 8, on macOS
bin/coursier resolve
sbt -Dsbt.build.version=$SBT_VER universal:packageBin universal:stage integrationTest/test
cd citest && ./test.sh
;;
3)
echo build using JDK 8, test using JDK 8, on Windows
bin/coursier.bat resolve
sbt -Dsbt.build.version=$SBT_VER universal:packageBin universal:stage integrationTest/test
cd citest
./test.bat
test3/test3.bat
;;
*)
echo unknown jobtype
exit 1
esac
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