forked from CoreASM/coreasm.core
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (87 loc) · 2.99 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 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 wether to skip or not should not lead to skipping
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ 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: ${{ needs.pre_job.outputs.should_skip != 'true' && !contains(github.event.head_commit.message, 'NOCI') }}
strategy:
fail-fast: false # don't stop other OS/JDK
matrix:
os: ['ubuntu-latest', 'windows-latest']
jdk: ['11', '17']
failFast: [true] # no need to test all files of a plugin on error
experimental: [false]
exclude:
- os: 'ubuntu-latest'
jdk: '11'
include:
- os: 'ubuntu-latest'
jdk: '11'
coverage: true
checkstyle: true
failFast: false
experimental: false
- os: 'ubuntu-latest'
jdk: '19'
failFast: false
experimental: true
- os: 'macos-latest'
jdk: '17'
experimental: true
continue-on-error: ${{ matrix.experimental }}
runs-on: ${{ matrix.os }}
env:
JDK_VERSION: ${{ matrix.jdk }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
- name: Compile
run: mvn -B compile --file pom.xml
- name: Test with coverage
if: ${{ matrix.coverage }}
run: mvn -B test "-DTestUtils.failFast=${{ matrix.failFast }}" --file pom.xml -P coverage
- name: Upload coverage
if: ${{ matrix.coverage }}
run: bash <(curl -s https://codecov.io/bash)
- name: Check Java style
if: ${{ matrix.checkstyle }}
run: mvn -B checkstyle:check
- name: Test without coverage
if: ${{ !matrix.coverage }}
run: mvn -B test "-DTestUtils.failFast=${{ matrix.failFast }}" --file pom.xml