Skip to content

Commit efbdad9

Browse files
committed
CI(Dependency): Dependency Check and Submission
1 parent e436e19 commit efbdad9

5 files changed

Lines changed: 91 additions & 8 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Dependency Check"
2+
3+
on:
4+
push:
5+
branches: [ 'develop', 'master', 'release_**', 'feat/state_root_sync' ]
6+
pull_request:
7+
branches: [ 'develop', "release_**" , 'feat/state_root_sync' ]
8+
schedule:
9+
- cron: '25 6 * * *'
10+
workflow_dispatch:
11+
12+
jobs:
13+
dependency-check:
14+
name: Dependency Check
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Cache ODC data
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.dependency-check/data
25+
key: ${{ runner.os }}-odc-data-${{ hashFiles('**/build.gradle') }}
26+
restore-keys: |
27+
${{ runner.os }}-odc-data-
28+
29+
- name: Set up JDK 8
30+
uses: actions/setup-java@v3
31+
with:
32+
java-version: '8'
33+
distribution: 'temurin'
34+
35+
- name: Gradlew build
36+
run: ./gradlew --no-daemon -S -Dorg.gradle.dependency.verification=off -Dorg.gradle.warning.mode=none build -x test
37+
38+
- name: Dependency Check
39+
uses: dependency-check/Dependency-Check_Action@1.1.0
40+
env:
41+
# actions/setup-java@v1 changes JAVA_HOME, so it needs to be reset to match the depcheck image
42+
JAVA_HOME: /opt/jdk
43+
with:
44+
project: 'java-tron'
45+
path: '.'
46+
format: 'HTML'
47+
out: 'reports'
48+
args: >
49+
--failOnCVSS 7
50+
--enableRetired
51+
- name: Generate timestamp
52+
run: echo "BUILD_TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S")" >> $GITHUB_ENV
53+
- name: Get Repository Name
54+
run: echo "REPO_NAME=$(echo '${{ github.repository }}' | cut -d'/' -f2)" >> $GITHUB_ENV
55+
- name: Upload report
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: dependency-check-${{ env.REPO_NAME }}-${{ env.BUILD_TIMESTAMP }}
60+
path: ${{github.workspace}}/reports
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Dependency Submission
2+
3+
on:
4+
push:
5+
branches: [ 'develop', 'master', 'release_**', 'feat/state_root_sync' ]
6+
pull_request:
7+
branches: [ 'develop', "release_**" , 'feat/state_root_sync' ]
8+
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
dependency-submission:
16+
runs-on: ubuntu-24.04-arm
17+
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
- name: Setup Java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'temurin'
25+
java-version: 17
26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v4
28+
- name: Generate and submit dependency graph
29+
uses: gradle/actions/dependency-submission@v4

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ println "Building for architecture: ${archInfo.name}, Java version: ${archInfo.j
4444

4545

4646
subprojects {
47+
apply plugin: "java"
4748
apply plugin: "jacoco"
4849
apply plugin: "maven-publish"
4950

common/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
version '1.0.0'
62

3+
74
dependencies {
85
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.18.3' // https://github.com/FasterXML/jackson-databind/issues/3627
96
api "com.cedarsoftware:java-util:3.2.0"

crypto/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
plugins {
2-
id 'java'
3-
}
4-
51
version '1.0.0'
62

73
repositories {

0 commit comments

Comments
 (0)