-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 2.3 KB
/
build.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
55
56
57
58
59
60
61
62
63
64
name: Maven PR Build
# We require all commits go through PR on GitHub
on:
pull_request:
branches:
- main
jobs:
build:
name: Maven PR Builder (JDK ${{ matrix.java }})
runs-on: ubuntu-latest
env:
MAVEN_CACHE_KEY: ${{ secrets.MAVEN_CACHE_KEY }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
UCLALIBRARY_SNYK_ORG: ${{ secrets.UCLALIBRARY_SNYK_ORG }}
strategy:
matrix:
java: [ 11 ]
steps:
- name: Set up build cache
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a # v2
if: ${{ env.MAVEN_CACHE_KEY }}
with:
path: |
~/.m2
lib
key: uclalibrary-cache-${{ env.MAVEN_CACHE_KEY }}-${{ hashFiles('**/pom.xml') }}
restore-keys: uclalibrary-cache-${{ env.MAVEN_CACHE_KEY }}-
- name: Check out code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Install JDK ${{ matrix.java }}
uses: actions/setup-java@8764a52df183aa0ccea74521dfd9d506ffc7a19a # v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
# If running locally in act, install Maven
- name: Set up Maven if needed
if: ${{ env.ACT }}
uses: stCarolas/setup-maven@1d56b37995622db66cce1214d81014b09807fb5a # v4
with:
maven-version: 3.6.3
- name: Install local dependencies
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709 # v1.4.0
with:
maven_goals_phases: "validate"
maven_profiles: default
maven_args: >
-V -ntp -Dorg.slf4j.simpleLogger.log.net.sourceforge.pmd=error
-Dsnyk.skip=${{ secrets.SKIP_SNYK }}
- name: Build with Maven
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709 # v1.4.0
with:
maven_goals_phases: "clean verify"
maven_profiles: default
maven_args: >
-V -ntp -Dorg.slf4j.simpleLogger.log.net.sourceforge.pmd=error -Ddocker.showLogs=true
-Ddocker.username=${{ secrets.DOCKER_USERNAME }} -Ddocker.password=${{ secrets.DOCKER_PASSWORD }}
-Dsnyk.skip=${{ secrets.SKIP_SNYK }}