-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (53 loc) · 2.14 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
55
56
57
58
59
60
61
62
63
64
65
66
67
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# 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: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for tabs
run: |
find "(" -name "*.java" -or -name "*.xml" -or -name "*.yaml" -or -name "*.yml" -or -name "*.txt" -or -name "*.md" ")" -exec grep -Pl "\t" {} \; > matches.txt
grep "" matches.txt && exit 1 || echo "No tab found!"
- name: Check for CRLF
run: |
find "(" -name "*.java" -or -name "*.xml" -or -name "*.yaml" -or -name "*.yml" -or -name "*.txt" -or -name "*.md" ")" -exec grep -Plz "\r\n" {} \; > matches.txt
grep "" matches.txt && exit 1 || echo "No CRLF found!"
- name: Check for trailing spaces
run: |
find "(" -name "*.java" -or -name "*.xml" -or -name "*.yaml" -or -name "*.yml" -or -name "*.txt" -or -name "*.md" ")" -exec grep -Pl " $" {} \; > matches.txt
grep "" matches.txt && exit 1 || echo "No trailing space found!"
- name: Clone open-vulnerability-clients fork
run: git clone https://github.com/maddie480/Open-Vulnerability-Project.git
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Build open-vulnerability-clients fork
run: |
cd Open-Vulnerability-Project/open-vulnerability-clients
../gradlew publishToMavenLocal --info
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
run: mvn -B verify -Prelease --file pom.xml
- name: Upload target folder as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: target
path: target