Skip to content

For #607. Finally patch CI to save Gradle javadocs #690

For #607. Finally patch CI to save Gradle javadocs

For #607. Finally patch CI to save Gradle javadocs #690

name: Gradle CI build
env:
OWASP_NVD_API_KEY: ${{ secrets.OWASP_NVD_API_KEY }}
# Workaround for: https://github.com/earthly/earthly/issues/4220
EARTHLY_DISABLE_REMOTE_REGISTRY_PROXY: true
on:
push:
paths-ignore:
- '*.md'
- 'images/**'
# These ignores are specific to a cross-build against Maven
- 'pom.xml'
- 'mvnw*'
- '.mvn'
# These ignores are specific to this project
- 'run-with-maven.sh'
- '.github/workflows/*maven*'
pull_request:
paths-ignore:
- '*.md'
- 'images/**'
# These ignores are specific to a cross-build against Maven
- 'pom.xml'
- 'mvnw*'
- '.mvn'
# These ignores are specific to this project
- 'run-with-maven.sh'
- '.github/workflows/*maven*'
jobs:
build:
name: Builds and tests
runs-on: ubuntu-latest
steps:
- name: Use Earthly
uses: earthly/actions-setup@v1
with:
# The version in CI should match the version you use locally.
# This is a manual step.
version: v0.8
- name: Clone repository
uses: actions/checkout@v4
- name: Restore Gradle caches
uses: actions/cache@master
env:
cache-name: gradle-cache
with:
path: ~/.gradle
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{hashFiles('**/build.gradle') }}
# TODO: See discussion: https://github.com/jeremylong/DependencyCheck/issues/2560#issuecomment-702098748
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build and test
run: earthly --secret OWASP_NVD_API_KEY +build-with-gradle
- name: Execute run script
run: earthly --secret OWASP_NVD_API_KEY +run-with-gradle
# Save artifacts for build
# See Earthfile that copies these from container to local
# Javadoc HTML and jars
- name: Save Javadoc HTML for main
uses: actions/upload-artifact@v4
with:
name: javadoc-html-main
if-no-files-found: error
path: build/docs/javadoc/
- name: Save Javadoc HTML Jar for main
uses: actions/upload-artifact@v4
with:
name: javadoc-jar-main
if-no-files-found: error
path: build/libs/modern-java-practices-0-SNAPSHOT-javadoc.jar
# Generate coverage report
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
if-no-files-found: error
path: build/reports/jacoco/test/