-
Notifications
You must be signed in to change notification settings - Fork 10
108 lines (97 loc) · 3.77 KB
/
gradle.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
98
99
100
101
102
103
104
105
106
107
108
# WARNING: Do not edit this file directly. Instead, go to:
#
# https://github.com/micronaut-projects/micronaut-project-template/tree/master/.github/workflows
#
# and edit them there. Note that it will be sync'ed to all the Micronaut repos
name: Java CI
on:
push:
branches:
- master
- '[1-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[1-9]+.[0-9]+.x'
jobs:
build:
if: github.repository != 'micronaut-projects/micronaut-project-template'
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17', '21']
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GH_TOKEN_PUBLIC_REPOS_READONLY: ${{ secrets.GH_TOKEN_PUBLIC_REPOS_READONLY }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
TESTCONTAINERS_RYUK_DISABLED: true
PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}"
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
# https://github.com/actions/virtual-environments/issues/709
- name: "🗑 Free disk space"
run: |
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo apt-get clean
df -h
- name: "📥 Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "🔧 Setup GraalVM CE"
uses: graalvm/[email protected]
with:
distribution: 'graalvm'
java-version: ${{ matrix.java }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "🔧 Setup Gradle"
uses: gradle/[email protected]
- name: "❓ Optional setup step"
run: |
[ -f ./setup.sh ] && ./setup.sh || [ ! -f ./setup.sh ]
- name: "🛠 Build with Gradle"
id: gradle
run: |
./gradlew check --no-daemon --continue
- name: "🔎 Run static analysis"
if: env.SONAR_TOKEN != '' && matrix.java == '17'
run: |
./gradlew sonar
- name: "📊 Publish Test Report"
if: always()
uses: mikepenz/action-junit-report@v5
with:
check_name: Java CI / Test Report (${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
check_retries: 'true'
- name: "📜 Upload binary compatibility check results"
if: matrix.java == '17'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: binary-compatibility-reports
path: "**/build/reports/binary-compatibility-*.html"
- name: "📦 Publish to Sonatype Snapshots"
if: success() && github.event_name == 'push' && matrix.java == '17'
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: ./gradlew publishToSonatype docs --no-daemon
- name: "❓ Determine docs target repository"
uses: haya14busa/action-cond@v1
id: docs_target
with:
cond: ${{ github.repository == 'micronaut-projects/micronaut-core' }}
if_true: "micronaut-projects/micronaut-docs"
if_false: ${{ github.repository }}
- name: "📑 Publish to Github Pages"
if: success() && github.event_name == 'push' && matrix.java == '17'
uses: micronaut-projects/github-pages-deploy-action@master
env:
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs