Skip to content

Unit Tests

Unit Tests #2057

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.11.0", jvmName: "temurin:1.11.0", extraOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { jdkVersion: "1.17.0", jvmName: "temurin:1.17.0", extraOpts: '' }
- { jdkVersion: "1.21.0", jvmName: "temurin:1.21", extraOpts: '' }
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
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
# https://github.com/coursier/cache-action/releases
# v6.4.5
uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d
- name: Set up JDK ${{ matrix.jdkVersion }}
# https://github.com/coursier/setup-action/releases
# v1.3.5
uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f
with:
jvm: ${{ matrix.jvmName }}
# FIXME default index not giving us access to JDK 21 (yet)
jvm-index: https://raw.githubusercontent.com/coursier/jvm-index/32d659500e6c65efb9eee91718a0fb0e797ad4ee/index.json
# hack to solve "Cannot assign requested address" issue - https://git.luolix.topmunity/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 {} \;