-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (76 loc) · 3.04 KB
/
unit-tests.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
83
84
85
86
87
88
89
90
name: Unit Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- release-*
tags-ignore: [ v.* ]
jobs:
test:
name: Build and Test
runs-on: ubuntu-20.04
if: github.repository == 'apache/pekko-management'
strategy:
fail-fast: false
matrix:
include:
- { javaVersion: 8, scalaVersion: 2.12, sbtOpts: '' }
- { javaVersion: 11, scalaVersion: 2.12, sbtOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { javaVersion: 8, scalaVersion: 2.13, sbtOpts: '' }
- { javaVersion: 11, scalaVersion: 2.13, sbtOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
- { javaVersion: 8, scalaVersion: 3.3, sbtOpts: '' }
- { javaVersion: 11, scalaVersion: 3.3, sbtOpts: '-J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler' }
steps:
- name: Checkout
uses: actions/checkout@v4
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 Java ${{ matrix.javaVersion }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.javaVersion }}
- name: Cache Coursier cache
uses: coursier/cache-action@v6
# 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: Check code formatted
run: sbt javafmtCheckAll
- name: Compile integration test
run: sbt "++${{ matrix.scalaVersion }} IntegrationTest/compile" ${{ matrix.sbtOpts }}
- name: Run tests with Scala ${{ matrix.scalaVersion }} and Java ${{ matrix.javaVersion }}
run: sbt "++${{ matrix.scalaVersion }} test" ${{ matrix.sbtOpts }}
- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
docs:
name: Docs compile
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
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 Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Cache Coursier cache
uses: coursier/cache-action@v6
- name: Create all API docs for artifacts/website and all reference docs
run: sbt "unidoc; docs/paradox"