-
Notifications
You must be signed in to change notification settings - Fork 16
54 lines (48 loc) · 1.38 KB
/
build-and-test.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: Build and test with Gradle
on: [workflow_dispatch, workflow_call, push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
java: [ '17', '21' ]
os: [ 'ubuntu-latest' ]
name: Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '1'
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: "Build and test"
shell: bash
run: |
java -version
javac -version
./gradlew --no-daemon check -x spotBugsMain -x shadowJar
- name: Publish Build
uses: actions/upload-artifact@v4
if: failure()
with:
name: build-${{ github.run_number }}-${{ matrix.java }}
path: ${{ github.workspace }}
gradle-scan:
name: Snyk gradle scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Snyk to check build.gradle for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: test
args: --severity-threshold=high --org=f310ee2f-5552-444d-84ee-ec8c44c33adb