-
Notifications
You must be signed in to change notification settings - Fork 229
78 lines (76 loc) · 2.65 KB
/
ci-build.yml
File metadata and controls
78 lines (76 loc) · 2.65 KB
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
name: Java CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
java-version: ["8", "14", "17"]
include:
- java-version: "8"
maven-opts: "-Djacoco.skip=true -Xmx4g -Xms512m"
- java-version: "14"
maven-opts: "-Xmx4g -Xms512m"
- java-version: "17"
maven-opts: "-Djacoco.skip=true -Xmx4g -Xms512m"
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install JDK ${{ matrix.java-version }}
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: ${{ matrix.java-version }}
distribution: "adopt"
- name: Cache Maven dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.m2/repository
key: v1-${{ runner.os }}-maven-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v1-${{ runner.os }}-maven-${{ matrix.java-version }}-
- name: Compile
run: |
if [ ${{ matrix.java-version }} == "8" ]; then
export TRAVIS_JDK=openjdk8
fi
./scripts/run_no_prep_tests.sh clean compile test-compile
env:
CI_ARGS: "--batch-mode"
MAVEN_OPTS: ${{ matrix.maven-opts }}
- name: Run tests
run: |
if [ ${{ matrix.java-version }} == "8" ]; then
export TRAVIS_JDK=openjdk8
fi
./scripts/run_no_prep_tests.sh test
env:
CI_ARGS: "--batch-mode"
SKIP_UNSTABLE_TESTS: 1
MAVEN_OPTS: ${{ matrix.maven-opts }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
directory: .
files: "**/target/surefire-reports/TEST-*.xml"
fail_ci_if_error: true
flags: jdk-${{ matrix.java-version }}
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
if: ${{ !cancelled() && hashFiles('**/target/site/jacoco/jacoco.xml') != '' }}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: "**/target/site/jacoco/jacoco.xml"
flags: jdk-${{ matrix.java-version }}
token: ${{ secrets.CODECOV_TOKEN }}