From 099d4a9bbe71640ac736e6fd1673870f45ee9052 Mon Sep 17 00:00:00 2001 From: Joe DiPol Date: Wed, 24 Apr 2024 07:57:28 -0700 Subject: [PATCH] Add validate workflow (#2) * Add validate workflow --- .github/workflows/validate.yml | 61 +++++++++++++++++++++++++++ etc/scripts/owasp-dependency-check.sh | 2 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..45530a2 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,61 @@ + +name: "Validate" + +on: [pull_request, push] + +env: + JAVA_VERSION: '21' + JAVA_DISTRO: 'oracle' + MAVEN_HTTP_ARGS: '-Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -Dmaven.wagon.http.retryHandler.count=3' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + copyright: + timeout-minutes: 10 + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up JDK ${{ env.JAVA_VERSION }} + uses: actions/setup-java@v4.1.0 + with: + distribution: ${{ env.JAVA_DISTRO }} + java-version: ${{ env.JAVA_VERSION }} + cache: maven + - name: Copyright + run: etc/scripts/copyright.sh + checkstyle: + timeout-minutes: 10 + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - name: Set up JDK ${{ env.JAVA_VERSION }} + uses: actions/setup-java@v4.1.0 + with: + distribution: ${{ env.JAVA_DISTRO }} + java-version: ${{ env.JAVA_VERSION }} + cache: maven + - name: Checkstyle + run: etc/scripts/checkstyle.sh + build: + timeout-minutes: 10 + strategy: + matrix: + os: [ ubuntu-20.04, macos-latest, windows-2022 ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up JDK ${{ env.JAVA_VERSION }} + uses: actions/setup-java@v4.1.0 + with: + distribution: ${{ env.JAVA_DISTRO }} + java-version: ${{ env.JAVA_VERSION }} + cache: maven + - name: Maven build + run: | + mvn -B -e $MAVEN_HTTP_ARGS clean install + diff --git a/etc/scripts/owasp-dependency-check.sh b/etc/scripts/owasp-dependency-check.sh index b912b3b..2d7a805 100755 --- a/etc/scripts/owasp-dependency-check.sh +++ b/etc/scripts/owasp-dependency-check.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2020, 2023 Oracle and/or its affiliates. +# Copyright (c) 2020, 2024 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.