Skip to content

51 Try to improve github jobs #6

51 Try to improve github jobs

51 Try to improve github jobs #6

Workflow file for this run

name: Java CI with Maven
on:
push:
branches:
- '*'
pull_request:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
java_version: ${{ steps.setup-java.outputs.java-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
id: setup-java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
build:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Use JDK ${{ needs.setup.outputs.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.setup.outputs.java_version }}
distribution: 'temurin'
cache: maven
- name: Compile with maven
run: mvn clean compile
checkstyle:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Use JDK ${{ needs.setup.outputs.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.setup.outputs.java_version }}
distribution: 'temurin'
cache: maven
- name: Checkstyle with maven
run: mvn checkstyle:check
test:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Use JDK ${{ needs.setup.outputs.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.setup.outputs.java_version }}
distribution: 'temurin'
cache: maven
- name: Compile maven project
run: mvn clean compile
- name: Test maven project
run: mvn test