Skip to content

Commit 96b4532

Browse files
ci: update gha config to use newer versions and actions (#179)
1 parent 3c8c879 commit 96b4532

7 files changed

+48
-92
lines changed

.github/workflows/merge-publish.yml

+3-15
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,17 @@ on:
77

88
jobs:
99
merge-publish:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1313
- name: Check out code
14-
uses: actions/checkout@v2.3.4
14+
uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
1717
submodules: recursive
18-
19-
- name: create checksum file
20-
uses: hypertrace/github-actions/checksum@main
21-
22-
- name: Cache packages
23-
uses: actions/cache@v2
24-
with:
25-
path: ~/.gradle
26-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
27-
restore-keys: |
28-
gradle-packages-${{ runner.os }}-${{ github.job }}
29-
gradle-packages-${{ runner.os }}
3018

3119
- name: Login to Docker Hub
32-
uses: docker/login-action@v1
20+
uses: docker/login-action@v2
3321
with:
3422
username: ${{ secrets.DOCKERHUB_READ_USER }}
3523
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}

.github/workflows/pr-build.yml

+6-38
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1515
- name: Check out code
16-
uses: actions/checkout@v2.3.4
16+
uses: actions/checkout@v3
1717
with:
1818
ref: ${{github.event.pull_request.head.ref}}
1919
repository: ${{github.event.pull_request.head.repo.full_name}}
@@ -23,34 +23,22 @@ jobs:
2323
- name: Ensure submodules point to commit from main branch
2424
run: git submodule foreach --recursive "git merge-base --is-ancestor HEAD origin/main"
2525

26-
- name: create checksum file
27-
uses: hypertrace/github-actions/checksum@main
28-
29-
- name: Cache packages
30-
uses: actions/cache@v2
31-
with:
32-
path: ~/.gradle
33-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
34-
restore-keys: |
35-
gradle-packages-${{ runner.os }}-${{ github.job }}
36-
gradle-packages-${{ runner.os }}
37-
3826
- name: Login to Docker Hub
39-
uses: docker/login-action@v1
27+
uses: docker/login-action@v2
4028
with:
4129
username: ${{ secrets.DOCKERHUB_READ_USER }}
4230
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
4331

4432
- name: Build with Gradle
4533
uses: hypertrace/github-actions/gradle@main
4634
with:
47-
args: build dockerBuildImages
35+
args: assemble dockerBuildImages
4836

4937
validate-helm-charts:
50-
runs-on: ubuntu-20.04
38+
runs-on: ubuntu-22.04
5139
steps:
5240
- name: Check out code
53-
uses: actions/checkout@v2.3.4
41+
uses: actions/checkout@v3
5442
with:
5543
ref: ${{github.event.pull_request.head.ref}}
5644
repository: ${{github.event.pull_request.head.repo.full_name}}
@@ -59,23 +47,3 @@ jobs:
5947

6048
- name: validate charts
6149
uses: hypertrace/github-actions/validate-charts@main
62-
63-
snyk-scan:
64-
runs-on: ubuntu-20.04
65-
steps:
66-
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
67-
- name: Check out code
68-
uses: actions/[email protected]
69-
with:
70-
ref: ${{github.event.pull_request.head.ref}}
71-
repository: ${{github.event.pull_request.head.repo.full_name}}
72-
fetch-depth: 0
73-
submodules: recursive
74-
75-
- name: Setup snyk
76-
uses: snyk/actions/[email protected]
77-
- name: Snyk test
78-
run: snyk test --all-sub-projects --org=hypertrace --severity-threshold=low --policy-path=.snyk --remote-repo-url='${{ github.server_url }}/${{ github.repository }}.git'
79-
env:
80-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
81-
GRADLE_OPTS: -Dorg.gradle.workers.max=1 # Snyk doesn't handle parallelism

.github/workflows/pr-test.yml

+11-19
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,22 @@ on:
77

88
jobs:
99
test:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1313
- name: Check out code
14-
uses: actions/checkout@v2.3.4
14+
uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
1717
submodules: recursive
18-
19-
- name: create checksum file
20-
uses: hypertrace/github-actions/checksum@main
21-
22-
- name: Cache packages
23-
id: cache-packages
24-
uses: actions/cache@v2
25-
with:
26-
path: ~/.gradle
27-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
28-
restore-keys: |
29-
gradle-packages-${{ runner.os }}-${{ github.job }}
30-
gradle-packages-${{ runner.os }}
3118

3219
- name: Unit test
3320
uses: hypertrace/github-actions/gradle@main
3421
with:
35-
args: jacocoTestReport
22+
args: check jacocoTestReport
3623

3724
- name: Upload coverage to Codecov
38-
uses: codecov/codecov-action@v2
25+
uses: codecov/codecov-action@v3
3926
with:
4027
name: unit test reports
4128
flags: unit
@@ -53,8 +40,13 @@ jobs:
5340
if: always()
5441

5542
- name: Publish Unit Test Results
56-
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v2
43+
uses: EnricoMi/publish-unit-test-result-action@v2
5744
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
5845
with:
5946
github_token: ${{ secrets.GITHUB_TOKEN }}
60-
junit_files: ./**/build/test-results/**/*.xml
47+
files: ./**/build/test-results/**/*.xml
48+
dependency-check:
49+
runs-on: ubuntu-22.04
50+
steps:
51+
- name: Dependency Check
52+
uses: hypertrace/github-actions/dependency-check@main

.github/workflows/publish.yml

+7-19
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,17 @@ on:
88

99
jobs:
1010
publish-artifacts:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212
steps:
1313
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
1414
- name: Check out code
15-
uses: actions/checkout@v2.3.4
15+
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
1818
submodules: recursive
19-
20-
- name: create checksum file
21-
uses: hypertrace/github-actions/checksum@main
22-
23-
- name: Cache packages
24-
uses: actions/cache@v2
25-
with:
26-
path: ~/.gradle
27-
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
28-
restore-keys: |
29-
gradle-packages-${{ runner.os }}-${{ github.job }}
30-
gradle-packages-${{ runner.os }}
3119

3220
- name: Login to Docker Hub
33-
uses: docker/login-action@v1
21+
uses: docker/login-action@v2
3422
with:
3523
username: ${{ secrets.DOCKERHUB_READ_USER }}
3624
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
@@ -45,11 +33,11 @@ jobs:
4533

4634
publish-helm-charts:
4735
needs: publish-artifacts
48-
runs-on: ubuntu-20.04
36+
runs-on: ubuntu-22.04
4937
steps:
5038
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
5139
- name: Checkout Repository
52-
uses: actions/checkout@v2.3.4
40+
uses: actions/checkout@v3
5341
with:
5442
fetch-depth: 0
5543
submodules: recursive
@@ -61,9 +49,9 @@ jobs:
6149
helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }}
6250

6351
publish-release-notes:
64-
runs-on: ubuntu-20.04
52+
runs-on: ubuntu-22.04
6553
steps:
66-
- uses: actions/checkout@v2.3.4
54+
- uses: actions/checkout@v3
6755
with:
6856
fetch-depth: 0
6957
- uses: hypertrace/github-actions/release-notes@main

build.gradle.kts

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
id("org.hypertrace.docker-java-application-plugin") version "0.9.5" apply false
66
id("org.hypertrace.docker-publish-plugin") version "0.9.5" apply false
77
id("org.hypertrace.code-style-plugin") version "1.1.2" apply false
8+
id("org.owasp.dependencycheck") version "8.1.2"
89
}
910

1011
subprojects {
@@ -29,3 +30,10 @@ subprojects {
2930
}
3031
}
3132
}
33+
34+
dependencyCheck {
35+
format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.ALL.toString()
36+
suppressionFile = "owasp-suppressions.xml"
37+
scanConfigurations.add("runtimeClasspath")
38+
failBuildOnCVSS = 7.0F
39+
}

owasp-suppressions.xml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
<suppress>
4+
<notes><![CDATA[
5+
Any hypertrace dep
6+
]]></notes>
7+
<packageUrl regex="true">^pkg:maven/org\.hypertrace\..*@.*$</packageUrl>
8+
<cpe>cpe:/a:grpc:grpc</cpe>
9+
<cpe>cpe:/a:utils_project:utils</cpe>
10+
<cpe>cpe:/a:processing:processing</cpe>
11+
</suppress>
12+
</suppressions>

0 commit comments

Comments
 (0)