Skip to content

Commit

Permalink
added unit tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
octonato committed Apr 19, 2021
1 parent e372f44 commit f3b0917
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unit Tests

on:
pull_request:
push:
branches:
- master
tags-ignore: [ v.* ]

jobs:
test:
name: Build and Test
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
include:
- { java-version: [email protected], scala-version: 2.12.13, sbt-opts: '' }
- { java-version: [email protected], scala-version: 2.12.13, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { java-version: [email protected], scala-version: 2.13.5, sbt-opts: '' }
- { java-version: [email protected], scala-version: 2.13.5, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
steps:
- name: Checkout
uses: actions/checkout@v2
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: Setup JDK ${{ matrix.java-version }}
uses: olafurpg/setup-scala@v10
with:
java-version: ${{ matrix.java-version }}

- name: Cache Coursier cache
uses: coursier/cache-action@v5

- name: Run tests with Scala ${{ matrix.scala-version }} and Java ${{ matrix.java-version }}
run: sbt "++${{ matrix.scala-version }} test" ${{ matrix.sbt-opts }}

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
6 changes: 6 additions & 0 deletions scripts/cat-log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
# ---------- helper script to separate log files in build
printf "\n\n\n"
ls -lh $1
printf "\n\n"
cat $1

0 comments on commit f3b0917

Please sign in to comment.