Skip to content

Commit c74cafb

Browse files
author
martinmeerAT
committed
Merge remote-tracking branch 'origin/master'
2 parents 1996ba6 + 2f6cbd8 commit c74cafb

File tree

2 files changed

+82
-74
lines changed

2 files changed

+82
-74
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "gradle" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/CDCI-master.yml

Lines changed: 71 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,54 @@
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
1+
name: CI/CD Pipeline for Java Project
62

73
on:
84
push:
95
branches:
10-
- '*'
6+
- master
117
pull_request:
128
branches:
13-
- '*'
14-
#defaults:
15-
#run:
16-
#working-directory: ./app
9+
- master
10+
1711
jobs:
1812
build:
1913
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
6514
steps:
66-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v3
16+
#JDK
6717
- name: Set up JDK 21
6818
uses: actions/setup-java@v4
6919
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-
20+
java-version: '21'
21+
distribution: 'corretto'
22+
#cache: 'gradle'
23+
#Gradle
24+
- name: Setup Gradle
25+
uses: gradle/actions/setup-gradle@v4
26+
- name: Validate Gradle wrapper
27+
uses: gradle/actions/wrapper-validation@v4
28+
29+
#Build
30+
- name: Build with Gradle
31+
run: make mkBuild
32+
- name: Test with Gradle
33+
run: make mkTest
34+
35+
#UploadArtifact
36+
37+
- name: Upload artifacts
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: build-output
41+
path: build/libs/*.war
42+
43+
#Snyk
7844
snyk:
7945
runs-on: ubuntu-latest
8046
permissions: write-all
8147
steps:
8248
- uses: actions/checkout@v4
8349
- name: Run Snyk to check for vulnerabilities
84-
uses: snyk/actions/gradle-jdk21@master
50+
uses: snyk/actions/gradle@master
51+
continue-on-error: true
8552
env:
8653
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
8754
with:
@@ -94,13 +61,43 @@ jobs:
9461
with:
9562
sarif_file: snyk.sarif
9663

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-
64+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
65+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
66+
dependency-submission:
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: write
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Set up JDK 21
73+
uses: actions/setup-java@v4
74+
with:
75+
java-version: "21"
76+
distribution: temurin
77+
- name: Generate and submit dependency graph
78+
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5
10079

101-
#run-on multiOS
102-
#runs-on: ${{ matrix.os }}
103-
#strategy:
104-
#matrix:
105-
#os: [ubuntu-latest, macos-latest]
106-
80+
#deploy:
81+
#needs: build
82+
#runs-on: ubuntu-latest
83+
#if: github.ref == 'refs/heads/main'
84+
#steps:
85+
#- uses: actions/checkout@v4
86+
#- name: Download artifacts
87+
#uses: actions/download-artifact@v3
88+
#with:
89+
#name: build-output
90+
#- name: Setup SSH key
91+
#env:
92+
#SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
93+
#SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
94+
#run: |
95+
#mkdir -p ~/.ssh/
96+
#echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
97+
#chmod 600 ~/.ssh/id_rsa
98+
#echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
99+
#chmod 644 ~/.ssh/known_hosts
100+
#- name: Deploy to Server
101+
#run: |
102+
#scp -o StrictHostKeyChecking=no build/libs/*.jar user@server:/path/to/project/
103+
#ssh user@server "cd /path/to/project && java -jar your-app.jar &"*/

0 commit comments

Comments
 (0)