forked from EricssonResearch/meca
-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (47 loc) · 1.45 KB
/
java-ci.yml
File metadata and controls
49 lines (47 loc) · 1.45 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
name: Java CI
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: write
pages: write
id-token: write
strategy:
matrix:
java: [ '17', '21', '25']
name: JDK ${{ matrix.Java }} build
steps:
- uses: actions/checkout@v5.0.0
- name: Set up Java
uses: actions/setup-java@v5.0.0
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4.4.2
- name: Build with Gradle headless
uses: coactions/setup-xvfb@v1.0.1
with:
run: ./gradlew clean build jacocoTestReport
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Test & publish code coverage
uses: qltysh/qlty-action/coverage@v2
with:
oidc: true
files: ${{github.workspace}}/build/reports/jacoco/test/jacocoTestReport.xml
add-prefix: src/main/java/