-
Notifications
You must be signed in to change notification settings - Fork 595
101 lines (84 loc) · 3.18 KB
/
validate-and-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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Validate and test
on:
pull_request:
push:
branches: [ main ]
tags-ignore: [ v* ]
permissions:
contents: read
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
formatting-check:
name: Checks
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0
- name: Set up JDK 17
uses: coursier/setup-action@v1.3.0
with:
jvm: temurin:1.17
- name: Cache Build Target
uses: actions/cache@v3.0.11
with:
path: project/**/target
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}
- name: Autoformat
run: sbt +headerCreateAll +scalariformFormat +test:scalariformFormat
- name: Check for missing formatting
run: git diff --exit-code --color
compile-and-test:
name: Compile and test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix: # align with publish-test-reports.yml
SCALA_VERSION: [2.12, 2.13, 3.2]
JDK_VERSION: ["1.8", "1.11", "1.17"]
include:
- JDK_VERSION: 1.8
JVM_NAME: temurin:1.8
extraOpts: '-J-Xmx2048M'
- JDK_VERSION: 1.11
JVM_NAME: temurin:1.11
extraOpts: ''
- JDK_VERSION: 1.17
JVM_NAME: temurin:1.17
extraOpts: ''
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0
- name: Set up JDK ${{ matrix.JDK_VERSION }}
uses: coursier/setup-action@v1.3.0
with:
jvm: ${{ matrix.JVM_NAME }}
- name: Cache Build Target
uses: actions/cache@v3.0.11
with:
path: project/**/target
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}
- name: Compile everything
run: sbt ++${{ matrix.SCALA_VERSION }} Test/compile ${{ matrix.extraOpts }}
# Quick testing for PR validation
- name: Validate pull request for JDK ${{ matrix.JDK_VERSION }}, Scala ${{ matrix.SCALA_VERSION }}
if: ${{ github.event_name == 'pull_request' }}
run: sbt -Dakka.http.parallelExecution=false -Dakka.test.timefactor=2 ++${{ matrix.SCALA_VERSION }} validatePullRequest ${{ matrix.extraOpts }}
# Full testing for pushes
- name: Run all tests JDK ${{ matrix.JDK_VERSION }}, Scala ${{ matrix.SCALA_VERSION }}
if: ${{ github.event_name == 'push' }}
run: sbt -Dakka.http.parallelExecution=false -Dakka.test.timefactor=2 ++${{ matrix.SCALA_VERSION }} mimaReportBinaryIssues test ${{ matrix.extraOpts }}
- name: Upload test results
uses: actions/upload-artifact@v3.1.1
if: success() || failure() # run this step even if previous step failed
with:
name: 'test-results-${{ matrix.JDK_VERSION }}-${{ matrix.SCALA_VERSION }}'
path: '**/target/test-reports/*.xml'