Repository navigation
53 lines (44 loc) · 1.66 KB
/
Copy pathvalidation.yml
File metadata and controls
53 lines (44 loc) · 1.66 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
45
46
47
48
49
50
51
52
53
# Simple test to verify code compiles with required Java versions.
name: validation
on:
pull_request:
branches:
- main
- 'release/**'
# A newer run for the same pull request supersedes this one.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
# Read-only: no step in this workflow writes to the repository.
permissions:
contents: read
jobs:
build-modules:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
java-version: ["17", "21", "25"]
steps:
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
# Only local git commands run later; don't leave the token on disk.
persist-credentials: false
- name: Set up Java ${{ matrix.java-version }}
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Cache Maven packages
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
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: Package and test (all) modules with Java ${{ matrix.java-version }}
run: ./mvnw -Prelease clean package
- name: Detected wrongly formatted files
run: git status && git diff --exit-code