-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 1.45 KB
/
ci.yml
File metadata and controls
67 lines (60 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on:
release:
types: [released, prereleased]
push:
branches:
- main
pull_request:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
packages: write
env:
JAVA_VERSION: 21
jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: ${{ env.JAVA_VERSION }}
cache: gradle
- name: Compile and test
run: ./gradlew build --info
- name: Check coverage
run: ./gradlew jacocoTestCoverageVerification --info
- name: Archive code coverage results
uses: actions/upload-artifact@v6
if: failure()
with:
name: build-reports
path: 'build/reports'
retention-days: 1
publish:
name: Publish
needs: [test]
if: github.event_name == 'release'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: ${{ env.JAVA_VERSION }}
cache: gradle
- name: Gradle publish
run: ./gradlew publish --info --no-daemon
env:
GH_USERNAME: ${{ github.actor }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}