Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updates to gradle build (WIP) #2

Draft
wants to merge 90 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
58a7986
chore: apply ci security best practices
step-security-bot Jan 6, 2024
1db18ec
chore: updates to gradle build
sgammon Jan 6, 2024
55be827
feat: earthly caching, reusable ci workflows
sgammon Jan 6, 2024
b001911
temp: issues with pmd and owasp
sgammon Jan 6, 2024
cd84a56
fix: align maven deps with gradle
sgammon Jan 6, 2024
699214f
feat: enable buildless for maven
sgammon Jan 6, 2024
0df415d
chore: skip daemon in earthly gradle builds
sgammon Jan 6, 2024
d16e064
fix: pass buildless key to earthly maven
sgammon Jan 6, 2024
363a797
chore: cleanup earthly caching (remote, not inline)
sgammon Jan 6, 2024
108ff77
chore: clearer maven/gradle caching in earthfile
sgammon Jan 6, 2024
d0fbeda
feat: gradle scans
sgammon Jan 7, 2024
0e95e3d
chore: cleanup/fixes for maven caching
sgammon Jan 7, 2024
43cf9c8
feat: optimized gradle download, use `bin` (slim) package
sgammon Jan 7, 2024
ad39237
fix: trust gradle enterprise plugin
sgammon Jan 7, 2024
f993394
feat: better earthly caching with dependency layers
sgammon Jan 7, 2024
b1cc6b6
fix: use of homedir in earthfile
sgammon Jan 7, 2024
cdebf95
temp: disable maven caching, creds aren't making it in
sgammon Jan 7, 2024
051666b
fix: global caching, repository caching for maven, in earthfile
sgammon Jan 7, 2024
2cba614
feat: initial on-push workflow to match on-pr
sgammon Jan 7, 2024
9dc32bd
fix: match javac flags between maven and gradle
sgammon Jan 7, 2024
700c626
fix: buildless apikey name mismatch
sgammon Jan 7, 2024
752fb07
fixup: re-enable buildless for maven
sgammon Jan 7, 2024
ad1e95d
temp: disable maven jdeps plugin; issues with jpms
sgammon Jan 7, 2024
80f2d5b
feat: finish ci refactor
sgammon Jan 7, 2024
f9924dd
fix: changes for maven build
sgammon Jan 7, 2024
3d29edd
fix: jpms/warning fixes for maven build
sgammon Jan 7, 2024
4550b4e
chore: fixes/enhancements to maven build flow
sgammon Jan 7, 2024
b9291b4
fixup: workflow permissions
sgammon Jan 7, 2024
f67efc2
chore: additional ci cleanup
sgammon Jan 7, 2024
64a0c64
fixup: wrong api key secret name
sgammon Jan 7, 2024
899e9e0
fixup: drop superfluous github token mapping from earthly calls
sgammon Jan 7, 2024
5f52a53
fixup: drop `--auto-skip` flag which requires earthly cloud
sgammon Jan 7, 2024
00586e9
fix: display and token fixes for earthly matrix
sgammon Jan 7, 2024
813ec76
fixup: display name for pr build jobs
sgammon Jan 7, 2024
024e576
Bump actions/upload-artifact from 3.1.3 to 4.0.0
dependabot[bot] Jan 7, 2024
d061ddc
Bump ossf/scorecard-action from 2.0.6 to 2.3.1
dependabot[bot] Jan 7, 2024
2c2fc4c
Bump actions/dependency-review-action from 2.5.1 to 3.1.5
dependabot[bot] Jan 7, 2024
5c09b19
Bump github/codeql-action from 2.22.12 to 3.22.12
dependabot[bot] Jan 7, 2024
d61021d
feat: apply ci refactors to batect
sgammon Jan 7, 2024
de14f1f
chore: cleanup previous ci jobs
sgammon Jan 7, 2024
246423e
fixup: re-enable batect in local script
sgammon Jan 7, 2024
b4cdb13
fixup: batect access to buildless key
sgammon Jan 7, 2024
8133984
feat: ci artifact support for all build jobs
sgammon Jan 7, 2024
b35f943
feat: direct gradle build with dependency graph
sgammon Jan 7, 2024
de9f67a
fixup: batect and ci flow fixes
sgammon Jan 7, 2024
14da9ba
fixup: fixes for gradle builds, add direct maven build
sgammon Jan 7, 2024
8af6d6f
fixup: job permissions for gradle direct build
sgammon Jan 7, 2024
6e64817
fix: permissions for maven direct build
sgammon Jan 7, 2024
29fe1ed
fixup: next round of batect, gradle, maven fixes
sgammon Jan 7, 2024
8ea6b51
fixup: further ci hardening for token permissions
sgammon Jan 7, 2024
4be6115
fixup: allow batect access to build cache for maven
sgammon Jan 7, 2024
dcbae6f
feat: sigstore signing for library releases
sgammon Jan 7, 2024
ed5b6f3
fixup: continued fixes for maven, batect, gradle
sgammon Jan 7, 2024
2ae8bfc
fix: remove duplicate checks for push on default branch
sgammon Jan 7, 2024
903e2d4
Bump org.apache.maven.plugins:maven-jxr-plugin from 3.3.1 to 3.3.2
dependabot[bot] Jan 7, 2024
35043cf
Bump org.mockito:mockito-core from 5.6.0 to 5.8.0
dependabot[bot] Jan 7, 2024
18cd0db
Bump org.apache.maven.plugins:maven-site-plugin
dependabot[bot] Jan 7, 2024
e2b7706
Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.1.0 to 4.8.2.0
dependabot[bot] Jan 7, 2024
db2b5cd
Bump com.puppycrawl.tools:checkstyle from 10.12.4 to 10.12.7
dependabot[bot] Jan 7, 2024
5b28b8d
Bump com.github.ben-manes.versions from 0.46.0 to 0.50.0
dependabot[bot] Jan 7, 2024
49509c1
Bump junit from 5.9.3 to 5.10.1
dependabot[bot] Jan 7, 2024
a163757
fixup: use gradle wrapper for direct build
sgammon Jan 7, 2024
0308c19
chore: update gradle lockfiles/verification metadata
sgammon Jan 7, 2024
825b044
fixup: ignore missing artifact paths
sgammon Jan 7, 2024
151d67c
fixup: drop maven site plugin
sgammon Jan 7, 2024
70e3d78
fix: allow pushing cached earthly container
sgammon Jan 7, 2024
2202d7f
feat: support for codecov/sonar scan actions
sgammon Jan 7, 2024
5c1256d
fixup: coverage flag for gradle build
sgammon Jan 7, 2024
fcc051b
fixup: sonar analysis fixes
sgammon Jan 7, 2024
4c0c376
fixup: trust github dependency graph plugin
sgammon Jan 7, 2024
3a90ac9
fixup: properly skip maven site plugin
sgammon Jan 7, 2024
b431099
fixup: emit xml coverage report in ci
sgammon Jan 7, 2024
aed1d34
fixup: drop duplicate gradle cache step
sgammon Jan 7, 2024
a4cafbd
fix: align adoptiom toolchain for gradle
sgammon Jan 7, 2024
68b04bc
feat: configure dependency review to match owasp plugin
sgammon Jan 7, 2024
a435919
fixup: retries for dependency snapshot pull
sgammon Jan 7, 2024
ba0e9cf
fix: replace setup java action for gradle build
sgammon Jan 7, 2024
6bbc282
fixup: newer `setup-java` actions
sgammon Jan 7, 2024
16f563f
fixup: package url suppresions for licenses
sgammon Jan 7, 2024
ce3e98d
fixup: avoid duplicate build during codeql scan
sgammon Jan 7, 2024
e8dcc0a
fixup: more purl fixes
sgammon Jan 7, 2024
cc1f672
fixup: string syntax for conditional in codeql job
sgammon Jan 7, 2024
3671ddd
feat: enhanced user data for gradle build scans
sgammon Jan 7, 2024
ed9d6b2
feat: build provenance for gradle build
sgammon Jan 7, 2024
0b95670
feat: enable docker buildx
sgammon Jan 7, 2024
97898db
chore: update gradle verification metadata
sgammon Jan 7, 2024
7cc5afd
fixup: permissions for gradle build
sgammon Jan 7, 2024
64b29f8
fixup: only enable provenance on master builds
sgammon Jan 7, 2024
b69e4f3
feat: manual dispatch of push job
sgammon Jan 7, 2024
82655eb
fixup: drop artifact feature from codeql workflow
sgammon Jan 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* text=auto
*.bat text eol=crlf
*.cmd text eol=crlf
*.gradle linguist-detectable language=Gradle
*.gradle.kts linguist-detectable language=Kotlin
14 changes: 14 additions & 0 deletions .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
license-check: true
vulnerability-check: true
allow-dependencies-licenses:
- pkg:maven/jakarta.annotation:jakarta.annotation-api
- pkg:github/batect/batect-wrapper-validation-action
- pkg:github/earthly/actions-setup

allow-ghsas:
# These match the list in `owasp-suppressions.xml`.
- "GHSA-5mg8-w23w-74h3"
- "GHSA-7g45-4rm6-3mm3"
- "GHSA-g6ph-x5wf-g337"
- "GHSA-jcwr-x25h-x5fh"
- "GHSA-fgq9-fc3q-vqmw"
76 changes: 76 additions & 0 deletions .github/workflows/checks.codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#

name: "CodeQL"

"on":
push:
branches: ["master"]
schedule:
- cron: "0 0 * * 1"
workflow_dispatch: {}
workflow_call:
secrets:
BUILDLESS_APIKEY:
description: "Build cache API key"
required: false

permissions:
contents: read

env:
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}

jobs:
analyze:
name: "CodeQL"
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: "Setup: Harden Runner"
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
persist-credentials: false
- name: "Setup: Caches"
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
env:
cache-name: caches-maven
with:
path: |
~/.m2/repository
~/.m2/wrapper
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}-jvm${{ inputs.java }}
# TODO: See discussion: https://github.com/jeremylong/DependencyCheck/issues/2560#issuecomment-702098748
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-jvm${{ inputs.java }}
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-
- name: "Setup: Buildless"
uses: buildless/setup@30e82389418c7f17046606183bc4c78b2c8913e0 # v1.0.2
- name: "Setup: Initialize CodeQL"
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
languages: java
- name: "CodeQL: Autobuild"
uses: github/codeql-action/autobuild@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
- name: "CodeQL: Analysis"
uses: github/codeql-action/analyze@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
category: "/language:java"
35 changes: 35 additions & 0 deletions .github/workflows/checks.dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: "Checks: Dependency Review"

"on":
workflow_call: {}

permissions:
contents: read
pull-requests: write
security-events: write

Check failure

Code scanning / Scorecard

Token-Permissions High

score is 0: topLevel 'security-events' permission set to 'write'
Remediation tip: Visit https://app.stepsecurity.io/secureworkflow.
Tick the 'Restrict permissions for GITHUB_TOKEN'
Untick other options
NOTE: If you want to resolve multiple issues at once, you can visit https://app.stepsecurity.io/securerepo instead.
Click Remediation section below for further remediation help

jobs:
dependency-review:
name: "Dependency Review"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- name: 'Checkout Repository'
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: 'Dependency Review'
uses: actions/dependency-review-action@c74b580d73376b7750d3d2a50bfb8adc2c937507 # v3.1.5
with:
config-file: "./.github/dependency-review-config.yml"
retry-on-snapshot-warnings: true
retry-on-snapshot-warnings-timeout: 300
73 changes: 73 additions & 0 deletions .github/workflows/checks.scorecards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.

name: "Checks: Scorecard"
"on":
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '20 7 * * 2'
push:
branches: ["master"]
workflow_call: {}
workflow_dispatch: {}

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: "Scorecard"
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
contents: read
actions: read
steps:
- name: "Setup: Harden Runner"
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
persist-credentials: false
- name: "Analysis: Scorecard"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecards on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Artifact: Scorecard"
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Artifact: Code Scanning"
uses: github/codeql-action/upload-sarif@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
sarif_file: results.sarif
69 changes: 0 additions & 69 deletions .github/workflows/ci-batect-gradle.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/ci-batect-maven.yml

This file was deleted.

Loading
Loading