Skip to content

Unit Tests

Unit Tests #1439

Workflow file for this run

name: Unit Tests
on:
pull_request:
push:
branches:
- main
- release-*
tags-ignore: [ v.* ]
schedule:
- cron: '0 2 * * *' # every day 2am
permissions:
contents: read
jobs:
test:
name: Build and Test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- { jdkVersion: "1.8.0", jvmName: "temurin:1.8.0", extraOpts: '' }
- { jdkVersion: "1.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' }
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
uses: coursier/[email protected]
- name: Set up JDK ${{ matrix.jdkVersion }}
uses: coursier/[email protected]
with:
jvm: ${{ matrix.jvmName }}
# hack to solve "Cannot assign requested address" issue - https://github.community/t/github-action-and-oserror-errno-99-cannot-assign-requested-address/173973/1
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- name: Run tests with default Scala and Java ${{ matrix.jdkVersion }}
run: sbt "test" ${{ matrix.extraOpts }}
- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;