Skip to content

codestyle

codestyle #575

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
workflow_dispatch:
inputs:
ref:
description: 'checkout reference (sha/branch)'
required: false
type: string
push:
branches-ignore:
- master
- upstream
pull_request:
branches-ignore:
- master
- upstream
jobs:
pre_job:
if: ${{ !contains(github.event.head_commit.message, 'NOCI') }}
continue-on-error: true # errors that happen when checking here whether to skip or not should not lead to skipping
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip_test: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '[".editorconfig", ".gitattributes", ".gitignore", "**/README*.md", "**/LICENSE*.md", "**/doc/**", "**/licenses/**", ".github/dependabot.yml"]'
concurrent_skipping: same_content_newer
build:
needs: pre_job
if: ${{ !contains(github.event.head_commit.message, 'NOCI') }}
strategy:
fail-fast: false # don't stop other OS/JDK
matrix:
os: ['ubuntu-latest', 'windows-latest']
jdk: ['17', '21']
failFast: [true] # no need to test all files of a plugin on error
experimental: [false]
exclude:
- os: 'ubuntu-latest'
jdk: '17'
include:
- os: 'ubuntu-latest'
jdk: '17'
coverage: ${{ github.ref == 'refs/heads/locke' }}
checkstyle: true
failFast: false
experimental: false
- os: 'ubuntu-latest'
jdk: '23'
failFast: false
experimental: true
- os: 'macos-latest'
jdk: '21'
experimental: true
continue-on-error: ${{ matrix.experimental }}
runs-on: ${{ matrix.os }}
env:
JDK_VERSION: ${{ matrix.jdk }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Compile & Package
run: mvn -B -DskipTests=true compile package --file pom.xml
- name: Test with coverage
if: ${{ matrix.coverage }}
run: mvn -B verify "-DTestUtils.failFast=${{ matrix.failFast }}" --file pom.xml -P coverage
- name: Upload coverage
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check Java style
if: ${{ matrix.checkstyle }}
run: mvn -B checkstyle:check
- name: Test without coverage
if: ${{ !matrix.coverage && needs.pre_job.outputs.should_skip_test != 'true' }}
run: mvn -B verify "-DTestUtils.failFast=${{ matrix.failFast }}" --file pom.xml