-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (70 loc) · 2.35 KB
/
check-build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on:
pull_request:
push:
branches:
- master
- main
- release-*
- 1.1.x
tags-ignore: [ v.* ]
jobs:
check-code-compilation:
name: Check Code Compilation
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- 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 Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Cache Coursier cache
uses: coursier/cache-action@v6
- name: Compile all code with default compiler
run: sbt "Test/compile"
test:
name: Build and Test
runs-on: ubuntu-20.04
needs: [check-code-compilation]
strategy:
fail-fast: false
matrix:
include:
- { java-version: 8, scala-version: 2.12, sbt-opts: '' }
- { java-version: 8, scala-version: 2.13, sbt-opts: '' }
- { java-version: 8, scala-version: 3.3, sbt-opts: '' }
- { java-version: 11, scala-version: 2.12, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { java-version: 11, scala-version: 2.13, sbt-opts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- 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 Java ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Cache Coursier cache
uses: coursier/cache-action@v6
- 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 {} \;