-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.7 KB
/
tests.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: tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
jobs:
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/[email protected]
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Cache Maven packages
uses: actions/[email protected]
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# As of 2025-01-02, this does not work due to the following error:
# Warning: EACCES: permission denied, scandir '/var/lib/docker'
# There are many threads about caching docker layers:
# https://github.com/orgs/community/discussions/26330
# https://github.com/actions/cache/issues/31
# https://github.com/actions/cache/issues/81
# https://github.com/actions/cache/issues/1224
# Most solutions seem focused on caching built images, no pulled images.
# - name: Cache Docker layers
# uses: actions/[email protected]
# with:
# path: /var/lib/docker
# key: ${{ runner.os }}-docker-layer-cache
# restore-keys: ${{ runner.os }}-docker-layer-cache
- name: Build and analyze
run: |
mvn \
-B \
clean \
verify \
--file pom.xml