diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 3b06870..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter -name-template: $NEXT_PATCH_VERSION -tag-template: $NEXT_PATCH_VERSION -version-template: $MAJOR.$MINOR.$PATCH - -# Emoji reference: https://gitmoji.carloscuesta.me/ -categories: - - title: ":boom: Breaking changes" - labels: - - breaking - - title: 🚨 Removed - label: removed - - title: ":tada: Major features and improvements" - labels: - - major-enhancement - - major-rfe - - title: 🐛 Major bug fixes - labels: - - major-bug - - title: ⚠️ Deprecated - label: deprecated - - title: 🚀 New features and improvements - labels: - - enhancement - - feature - - rfe - - title: 🐛 Bug Fixes - labels: - - bug - - fix - - bugfix - - regression - - title: ":construction_worker: Changes for plugin developers" - labels: - - developer - # Default label used by Dependabot - - title: 📦 Dependency updates - label: dependencies - - title: 📝 Documentation updates - label: documentation - - title: 👻 Maintenance - labels: - - chore - - internal - - maintenance - - title: 🚦 Tests - labels: - - test - - tests -exclude-labels: - - reverted - - no-changelog - - skip-changelog - - invalid - -template: | - - $CHANGES diff --git a/.github/workflows/maven-verify-with-its-test.yml b/.github/workflows/maven-verify-test.yml similarity index 73% rename from .github/workflows/maven-verify-with-its-test.yml rename to .github/workflows/maven-verify-test.yml index d3833be..73ee6f1 100644 --- a/.github/workflows/maven-verify-with-its-test.yml +++ b/.github/workflows/maven-verify-test.yml @@ -15,12 +15,22 @@ # specific language governing permissions and limitations # under the License. -name: Verify +name: Verify - Test on: push jobs: - build: - name: Verify + + verify-1: + name: Verify 1 + # for testing purpose you can change to your fork and branch + uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1 + + verify-2: + name: Verify 2 # for testing purpose you can change to your fork and branch - uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify-with-its.yml@main + uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1 + with: + ff-goal: test + verify-goal: clean install + verify-fail-fast: false diff --git a/.github/workflows/maven-verify-with-its.yml b/.github/workflows/maven-verify.yml similarity index 58% rename from .github/workflows/maven-verify-with-its.yml rename to .github/workflows/maven-verify.yml index e6e147e..965f542 100644 --- a/.github/workflows/maven-verify-with-its.yml +++ b/.github/workflows/maven-verify.yml @@ -21,9 +21,15 @@ on: workflow_call: inputs: maven_args: - description: The arguments to pass to Maven when building the code + description: The arguments to pass to all Maven commands when building the code required: false - default: -P run-its -D"invoker.streamLogsOnFailures" + default: '-D"invoker.streamLogsOnFailures"' + type: string + + maven_version: + description: The Maven version used for builds + required: false + default: '3.8.4' type: string os-matrix: @@ -60,7 +66,7 @@ on: ff-jdk: description: The jdk version used during fail-fast-build job required: false - default: '8' + default: '11' type: string ff-jdk-distribution: @@ -69,6 +75,37 @@ on: default: 'temurin' type: string + ff-goal: + description: The Maven goal used by fail-fast-build job + required: false + default: '-P run-its verify' + type: string + + ff-site-goal: + description: The Maven goal used by fail-fast-build job to build site + required: false + default: '-DskipTests -P reporting site' + type: string + + verify-goal: + description: The Maven goal used by verfy jobs + required: false + default: '-P run-its verify' + type: string + + verify-site-goal: + description: The Maven goal used by verfy jobs to build site + required: false + default: '-DskipTests -P reporting site' + type: string + + verify-fail-fast: + description: Determinate if verification matrix should fail fast + required: false + default: true + type: boolean + + jobs: # verify build on one node - before matrix will start @@ -78,17 +115,26 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up JDK - uses: actions/setup-java@v2.3.1 + uses: actions/setup-java@v4 with: java-version: ${{ inputs.ff-jdk }} distribution: ${{ inputs.ff-jdk-distribution }} cache: 'maven' + - name: Set up Maven + run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=${{ inputs.maven_version }}" + - name: Build with Maven - run: mvn --errors --batch-mode --show-version ${{ inputs.maven_args }} verify + run: ./mvnw --errors --batch-mode --show-version ${{ inputs.maven_args }} ${{ inputs.ff-goal }} + + - name: Build Maven Site + run: ./mvnw --errors --batch-mode --show-version ${{ inputs.maven_args }} ${{ inputs.ff-site-goal }} + verify: needs: fail-fast-build @@ -97,7 +143,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: - fail-fast: true + fail-fast: ${{ inputs.verify-fail-fast }} matrix: os: ${{ fromJSON( inputs.os-matrix ) }} jdk: ${{ fromJSON( inputs.jdk-matrix ) }} @@ -110,25 +156,33 @@ jobs: if: > matrix.os != inputs.ff-os || matrix.jdk != inputs.ff-jdk || - matrix.distribution != inputs.ff-jdk-distribution + matrix.distribution != inputs.ff-jdk-distribution || + inputs.verify-goal != inputs.ff-goal || + inputs.verify-site-goal != inputs.ff-site-goal run: echo ok - name: Checkout if: steps.should-run.conclusion == 'success' - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up JDK if: steps.should-run.conclusion == 'success' - uses: actions/setup-java@v2.3.1 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.jdk }} distribution: ${{ matrix.distribution }} cache: 'maven' + - name: Set up Maven + if: steps.should-run.conclusion == 'success' + run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=${{ inputs.maven_version }}" + - name: Build with Maven if: steps.should-run.conclusion == 'success' - run: mvn --errors --batch-mode --show-version ${{ inputs.maven_args }} verify + run: ./mvnw --errors --batch-mode --show-version ${{ inputs.maven_args }} ${{ inputs.verify-goal }} - name: Build Maven Site if: steps.should-run.conclusion == 'success' - run: mvn --errors --batch-mode --show-version ${{ inputs.maven_args }} site + run: ./mvnw --errors --batch-mode --show-version ${{ inputs.maven_args }} ${{ inputs.verify-site-goal }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index e063da2..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -name: Release Drafter -on: - push: - branches: - - main - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v5.15.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index d3c5035..de6909d 100644 --- a/README.md +++ b/README.md @@ -14,44 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Maven shared GitHub Actions - +# Apache Maven Shared GitHub Actions # Usage -Create GitHub workflow in project with content: - -```yaml -name: Verify - -on: - push: - branches-ignore: - - dependabot/** - pull_request: - -jobs: - build: - name: Verify - uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify-with-its.yml@main - -``` - -Excludes from build matrix: - -```yaml -... - uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify-with-its.yml@main - with: - matrix-exclude: > - [ - {"jdk": "8"}, # exclude jdk 8 from all builds - {"os": "windows-latest"}, # exclude windows from all builds - {"jdk": "8", "os": "windows-latest"} # exclude jkd 8 on windows - ] -``` - -# Resources - -- [Workflow syntax](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions) -- [Reusing workflows](https://docs.github.com/en/actions/learn-github-actions/reusing-workflows) +https://github.com/apache/maven-gh-actions-shared/