-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (52 loc) · 1.38 KB
/
maven.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
name: maven
on:
push:
paths:
- 'pom.xml'
- 'src/**'
- '.github/workflows/maven.yml'
pull_request:
paths:
- 'pom.xml'
- 'src/**'
- '.github/workflows/maven.yml'
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v3
with:
lfs: false
if: github.event.inputs.git-ref == ''
- name: Clone Repository (manual ref)
uses: actions/checkout@v3
with:
lfs: false
ref: ${{ github.event.inputs.git-ref }}
if: github.event.inputs.git-ref != ''
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Lint GitHub Actions
run: npx yaml-lint .github/workflows/*.yml
- name: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile test-compile
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}