-
Notifications
You must be signed in to change notification settings - Fork 290
44 lines (36 loc) · 1.2 KB
/
validation.yml
File metadata and controls
44 lines (36 loc) · 1.2 KB
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
# Simple test to verify code compiles with required Java versions.
name: validation
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-modules:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
java-version: ["17", "21"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}
restore-keys: | # Fallback keys if exact match is not found
${{ runner.os }}-maven-${{ matrix.java-version }}-
${{ runner.os }}-maven-
- name: Compile and test (all) modules with Java ${{ matrix.java-version }}
run: ./mvnw clean test
- name: Detected wrongly formatted files
run: git status && git diff --exit-code