This repository was archived by the owner on Jan 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (75 loc) · 3.61 KB
/
maven.yml
File metadata and controls
90 lines (75 loc) · 3.61 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Java CI
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
if: "! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
strategy:
fail-fast: true
matrix:
language: [ 'java' ]
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: Cache
uses: actions/cache@v3.2.3
with:
# A directory to store and save the cache
path: cache
# An explicit key for restoring and saving the cache
key: cache
- name: Checkout Source
uses: actions/checkout@v3.3.0
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3.9.0
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Cache SonarCloud packages
uses: actions/cache@v3.2.3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3.2.3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: shellcheck
uses: ludeeus/action-shellcheck@1.1.0
- name: Initialize CodeQL
uses: github/codeql-action/init@main
with:
languages: java
# queries: security-extended,security-and-quality,github/codeql/java/ql/src/codeql-suites/java-lgtm-full.qls@main
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# org.jacoco:jacoco-maven-plugin:prepare-agent org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
run: |
./mvnw clean verify --threads 1C --batch-mode --errors
- name: Test CLI
run: |
java -jar target/bytecode-version-analyzer.jar --debug --fail-verbosity warn --loadPom --help
java -jar target/bytecode-version-analyzer.jar --debug --fail-verbosity warn --loadPom target/classes/com/lifemcserver/bytecodeversionanalyzer/BytecodeVersionAnalyzer.class
java -jar target/bytecode-version-analyzer.jar --debug --fail-verbosity warn --loadPom target/bytecode-version-analyzer.jar
java -jar target/bytecode-version-analyzer.jar --debug --fail-verbosity warn --loadPom target/original-bytecode-version-analyzer.jar
java -jar target/bytecode-version-analyzer.jar --debug --fail-verbosity warn --loadPom target/classes/com/lifemcserver/bytecodeversionanalyzer/BytecodeVersionAnalyzer.class target/original-bytecode-version-analyzer.jar
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: bytecode-version-analyzer-nightly.jar
path: target/*.jar
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@main