-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.6 KB
/
ci.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches:
- main
- master
- dev
- develop
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Cache local Maven repository
uses: actions/[email protected]
env:
cache-name: cache-mvn
with:
path: ~/.m2/repository
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Compile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: mvn -B clean compile -DskipTests=true --file pom.xml -U
- name: Test with Maven
run: mvn -B test -DskipTests=false
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
# possibly other stuff
token: ${{ secrets.CODECOV_ORG_TOKEN }}
fail_ci_if_error: false # or true if you want CI to fail when Codecov fails