Skip to content

Update Sbt and plugins, fix some deprecations, support Java 11 #295

Update Sbt and plugins, fix some deprecations, support Java 11

Update Sbt and plugins, fix some deprecations, support Java 11 #295

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
##################################
## Running all unit tests ##
##################################
unitTests:
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache .ivy2
uses: actions/cache@v1
with:
path: /home/runner/.ivy2
key: cmwell-unitTests-ivy2-${{ hashFiles('**/build.sbt') }}
restore-keys: cmwell-unitTests-ivy2
- name: Cache coursier
uses: actions/cache@v1
with:
path: /home/runner/.cache/coursier
key: cmwell-unitTests-coursier-${{ hashFiles('**/build.sbt') }}
restore-keys: cmwell-unitTests-coursier
- name: Compile
timeout-minutes: 10
working-directory: server
run: sbt compile
- name: Test
working-directory: server
timeout-minutes: 30
run: sbt test
# Copy logs to 1 directory, since upload-artifact doesnt support multiple directories or regular expressions
- name: Aggregate logs (to be saved in later steps)
if: always()
run: |
mkdir logsArtifacts
find . -name logs | xargs -I LOG cp -r --parents LOG logsArtifacts/
#####################################
## Save Artifacts ##
#####################################
- name: Save Unit Tests Logs
uses: actions/upload-artifact@v1
if: always()
with:
name: logsArtifacts
path: logsArtifacts
- name: Save Grid Unit Tests Logs 1
uses: actions/upload-artifact@v1
if: always()
with:
name: client1.out
path: server/cmwell-grid/target/client1.out
- name: Save Grid Unit Tests Logs 2
uses: actions/upload-artifact@v1
if: always()
with:
name: client2.out
path: server/cmwell-grid/target/client2.out
- name: Save Grid Unit Tests Logs 3
uses: actions/upload-artifact@v1
if: always()
with:
name: node.out
path: server/cmwell-grid/target/node.out
#####################################
## Running all integration tests ##
#####################################
integrationTests:
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache ivy2
uses: actions/cache@v1
with:
path: /home/runner/.ivy2
key: cmwell-it-ivy2-${{ hashFiles('**/build.sbt') }}
restore-keys: cmwell-it-ivy2
- name: Cache coursier
uses: actions/cache@v1
with:
path: /home/runner/.cache/coursier
key: cmwell-it-coursier-${{ hashFiles('**/build.sbt') }}
restore-keys: cmwell-it-coursier
- name: Cache Scala 2.13
uses: actions/cache@v1
with:
path: /home/runner/scala
key: scala-${{ hashFiles('**/extract-java-scala.sh') }}
- name: Install Scala
run: |
scalaLocation="/home/runner/scala"
scalaVersion=$(grep "Global / scalaVersion" /home/runner/work/CM-Well/CM-Well/server/build.sbt | awk '{print $NF}' | tr -d \")
if [ ! -d "$scalaLocation/scala-$scalaVersion" ]; then
echo "Scala does not exist! Going to download"
mkdir $scalaLocation
cd $scalaLocation
wget https://downloads.lightbend.com/scala/$scalaVersion/scala-$scalaVersion.tgz
sudo tar -xf scala-$scalaVersion.tgz
sudo ln -s $scalaLocation/scala-$scalaVersion/bin/scala /usr/local/bin/scala
else
echo "Scala exist. Will only create the sym-link"
sudo ln -s $scalaLocation/scala-$scalaVersion/bin/scala /usr/local/bin/scala
fi
- name: Integration Tests
timeout-minutes: 30
working-directory: server
run: sbt IntegrationTest/test
#####################################
## Save IT Artifacts ##
#####################################
- name: Save Integration Tests Logs (test logs)
uses: actions/upload-artifact@v1
if: always()
with:
name: itLogs
path: server/cmwell-it/target/logs
- name: Save Integration Tests Logs (server logs)
uses: actions/upload-artifact@v1
if: always()
with:
name: cmwellItLogs
path: server/cmwell-it/target/cm-well/log