|
1 | 1 | # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
2 |
| -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven |
3 |
| - |
4 |
| -# This workflow uses actions that are not certified by GitHub. |
5 |
| -# They are provided by a third-party and are governed by |
6 |
| -# separate terms of service, privacy policy, and support |
7 |
| -# documentation. |
8 |
| - |
| 2 | +# For more information see: |
| 3 | +# - https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven |
| 4 | +# - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions |
9 | 5 | name: Java CI with Maven
|
10 | 6 |
|
11 | 7 | on:
|
12 | 8 | push:
|
13 |
| - branches: [ "master" ] |
| 9 | + branches-ignore: # build all branches except: |
| 10 | + - 'dependabot/**' # prevent GHA triggered twice (once for commit to the branch and once for opening/syncing the PR) |
| 11 | + tags-ignore: # don't build tags |
| 12 | + - '**' |
| 13 | + paths-ignore: |
| 14 | + - 'Jenkinsfile' |
| 15 | + - 'LICENSE' |
| 16 | + - '**/*.md' |
| 17 | + - '.git*' |
| 18 | + - '.github/*.yml' |
14 | 19 | pull_request:
|
15 |
| - branches: [ "master" ] |
| 20 | + paths-ignore: |
| 21 | + - 'Jenkinsfile' |
| 22 | + - 'LICENSE' |
| 23 | + - '**/*.md' |
| 24 | + - '.git*' |
| 25 | + - '.github/*.yml' |
| 26 | + workflow_dispatch: |
| 27 | + # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ |
| 28 | + |
| 29 | + |
| 30 | +defaults: |
| 31 | + run: |
| 32 | + shell: bash |
| 33 | + |
16 | 34 |
|
17 | 35 | jobs:
|
18 | 36 | build:
|
19 |
| - |
20 | 37 | runs-on: ubuntu-latest
|
21 | 38 |
|
| 39 | + env: |
| 40 | + JAVA_VERSION: 11 |
| 41 | + |
22 | 42 | steps:
|
23 |
| - - uses: actions/checkout@v3 |
24 |
| - - name: Set up JDK 11 |
25 |
| - uses: actions/setup-java@v3 |
| 43 | + - name: Git Checkout |
| 44 | + uses: actions/checkout@v4 # https://github.com/actions/checkout |
| 45 | + |
| 46 | + - name: Set up JDK ${{ env.JAVA_VERSION }} ☕ |
| 47 | + uses: actions/setup-java@v4 # https://github.com/actions/setup-java |
26 | 48 | with:
|
27 |
| - java-version: '11' |
28 |
| - distribution: 'temurin' |
| 49 | + java-version: ${{ env.JAVA_VERSION }} |
| 50 | + distribution: temurin |
29 | 51 | cache: maven
|
30 |
| - - name: Build with Maven |
31 |
| - run: mvn -B package --file pom.xml |
| 52 | + |
| 53 | + - name: Build with Maven 🔨 |
| 54 | + run: mvn -ntp -B verify |
0 commit comments