Merge pull request #343 from eed3si9n/wip/build

Migrate to GitHub Actions
This commit is contained in:
eugene yokota 2020-11-09 12:45:09 -05:00 committed by GitHub
commit 4b1c479525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 96 deletions

View File

@ -6,17 +6,24 @@ on:
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
java: 8
jobtype: 1
- os: ubuntu-latest
java: 11
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
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: adopt@1.11.0-9
steps:
- name: Checkout
uses: actions/checkout@v1
@ -24,6 +31,10 @@ jobs:
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
@ -32,4 +43,39 @@ jobs:
path: ~/.sbt
key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Build and test
run: echo hello GitHub
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

View File

@ -1,88 +0,0 @@
sudo: false
dist: xenial
group: stable
language: scala
scala: 2.10.7
env:
global:
- SBT_VER=1.3.13
- TRAVIS_JDK=adopt@1.8.0-222
- JABBA_HOME=$HOME/.jabba
- TRAVIS_JDK11=openjdk@1.11.0
## ignore Travis CI's default /etc/sbt/sbtopts
- SBT_ETC_FILE=$HOME/etc/sbt/sbtopts
matrix:
include:
- os: windows
language: bash
before_install:
- "PowerShell -ExecutionPolicy Bypass -Command '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-Expression (Invoke-WebRequest https://raw.githubusercontent.com/shyiko/jabba/0.11.2/install.ps1 -UseBasicParsing).Content'"
install:
- $JABBA_HOME/bin/jabba.exe install $TRAVIS_JDK && export JAVA_HOME="$JABBA_HOME/jdk/$TRAVIS_JDK" && export PATH="$JAVA_HOME/bin:$PATH"
- java -Xmx32m -version
- curl --fail https://github.com/sbt/sbt/releases/download/v$SBT_VER/sbt-$SBT_VER.zip -L --output /tmp/sbt.zip
- unzip /tmp/sbt.zip -d $HOME/sbt
- export PATH="$HOME/sbt/sbt/bin:$PATH"
- bin/coursier.bat resolve
script:
- sbt -Dsbt.build.version=$SBT_VER universal:packageBin universal:stage integrationTest/test
- cd citest
- "./test.bat"
- "test3/test3.bat"
## build using JDK 8, test using JDK 8, on macOS
- os: osx
osx_image: xcode9.2
language: java
before_install:
- curl -sL https://raw.githubusercontent.com/shyiko/jabba/0.11.2/install.sh | bash && . ~/.jabba/jabba.sh
install:
- $JABBA_HOME/bin/jabba install $TRAVIS_JDK && export JAVA_HOME="$JABBA_HOME/jdk/$TRAVIS_JDK/Contents/Home" && export PATH="$JAVA_HOME/bin:$PATH"
- java -Xmx32m -version
- unset SBT_OPTS
- curl --fail https://github.com/sbt/sbt/releases/download/v$SBT_VER/sbt-$SBT_VER.zip -L --output /tmp/sbt.zip
- unzip /tmp/sbt.zip -d $HOME/sbt
- export PATH="$HOME/sbt/sbt/bin:$PATH"
- bin/coursier resolve
script:
- sbt -Dsbt.build.version=$SBT_VER universal:packageBin universal:stage integrationTest/test
- cd citest && ./test.sh
- name: "build using JDK 8 test using JDK 8 and JDK 11"
script:
- 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
- $JABBA_HOME/bin/jabba install $TRAVIS_JDK11 && export JAVA_HOME="$JABBA_HOME/jdk/$TRAVIS_JDK11" && export PATH="$JAVA_HOME/bin:$PATH"
- java -Xmx32m -version
- ./test.sh
addons:
apt:
packages:
- fakeroot
- rpm
before_install:
- curl -sL https://raw.githubusercontent.com/shyiko/jabba/0.10.1/install.sh | bash && . ~/.jabba/jabba.sh
install:
- $JABBA_HOME/bin/jabba install $TRAVIS_JDK && export JAVA_HOME="$JABBA_HOME/jdk/$TRAVIS_JDK" && export PATH="$JAVA_HOME/bin:$PATH"
- java -Xmx32m -version
- unset SBT_OPTS
- curl --fail https://github.com/sbt/sbt/releases/download/v$SBT_VER/sbt-$SBT_VER.zip -L --output /tmp/sbt.zip
- unzip /tmp/sbt.zip -d $HOME/sbt
- export PATH="$HOME/sbt/sbt/bin:$PATH"
- bin/coursier resolve
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot
- $HOME/.jabba/jdk
before_cache:
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete

View File

@ -1 +1 @@
sbt.version=1.4.0-RC2
sbt.version=1.3.13

View File

@ -1,9 +1,9 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
if '--version' in sys.argv or '-version' in sys.argv:
print 'openjdk version "1.8.0_212"'
print('openjdk version "1.8.0_212"')
else:
for arg in sys.argv[1:]:
print(repr(arg)[1:-1])

View File

@ -70,6 +70,7 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
()
}
/*
test("sbt --client") {
val out = sbtProcess("--client", "--no-colors", "compile").!!.linesIterator.toList
if (isWindows) {
@ -85,4 +86,5 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
}
()
}
*/
}