Skip to content

Commit 5d17539

Browse files
authored
Create CDCI-master.yml
1 parent 3d07150 commit 5d17539

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/CDCI-master.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
#run-name: ${{ github.actor }}'s own workflow Java CI with Gradle
6+
7+
on:
8+
push:
9+
branches:
10+
- '*'
11+
pull_request:
12+
branches:
13+
- '*'
14+
#defaults:
15+
#run:
16+
#working-directory: ./app
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up JDK 21
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: "21"
28+
distribution: temurin
29+
cache: gradle
30+
- name: Setup Gradle
31+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
32+
id: setup-gradle
33+
with:
34+
gradle-version: current
35+
36+
37+
38+
- run: gradle build --dry-run
39+
- run: echo "The current Gradle version was ${{ steps.setup-gradle.outputs.gradle-version }}"
40+
41+
- name: Test with Gradle Wrapper
42+
run: make run-test
43+
- run: echo "Test was sucsessful!"
44+
#cache-dependency-path: | # optional
45+
#sub-project/*.gradle*
46+
#sub-project/**/gradle-wrapper.properties
47+
48+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
49+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
50+
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
51+
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
52+
53+
# - name: Setup Gradle
54+
# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
55+
# with:
56+
# gradle-version: '8.5'
57+
#
58+
# - name: Build with Gradle 8.5
59+
# run: gradle build
60+
61+
dependency-submission:
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: write
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: Set up JDK 21
68+
uses: actions/setup-java@v4
69+
with:
70+
java-version: "21"
71+
distribution: temurin
72+
- name: Generate and submit dependency graph
73+
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5
74+
#with:
75+
#build-root-directory: ./app
76+
77+
78+
snyk:
79+
runs-on: ubuntu-latest
80+
permissions: write-all
81+
steps:
82+
- uses: actions/checkout@v4
83+
- name: Run Snyk to check for vulnerabilities
84+
uses: snyk/actions/gradle-jdk@master
85+
env:
86+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
87+
with:
88+
args:
89+
--all-sub-projects
90+
--severity-threshold=medium
91+
--sarif-file-output=snyk.sarif
92+
- name: Upload result to GitHub Code Scanning
93+
uses: github/codeql-action/upload-sarif@v3
94+
with:
95+
sarif_file: snyk.sarif
96+
97+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
98+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
99+
100+
101+
#run-on multiOS
102+
#runs-on: ${{ matrix.os }}
103+
#strategy:
104+
#matrix:
105+
#os: [ubuntu-latest, macos-latest]
106+

0 commit comments

Comments
 (0)