-
-
Notifications
You must be signed in to change notification settings - Fork 4
152 lines (125 loc) 路 4.84 KB
/
Copy pathgradle.yml
File metadata and controls
152 lines (125 loc) 路 4.84 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Build
on:
push:
branches: [ "main" ]
paths-ignore:
- AGENTS.md
pull_request:
branches: [ "main" ]
paths-ignore:
- AGENTS.md
merge_group:
branches: [ "main" ]
env:
JVM_VERSION: 17
JVM_DISTRIBUTION: temurin
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.ref }}
# Cancel only when the run is not on main or develop
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Fetch main branch
run: git fetch origin main
- name: Set up JDK ${{ env.JVM_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JVM_VERSION }}
distribution: ${{ env.JVM_DISTRIBUTION }}
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: 馃悩Setup Gradle
uses: gradle/actions/setup-gradle@263d8fe18eb54ae581bcdc2e263c5a49173958a3
with:
add-job-summary-as-pr-comment: on-failure # Valid values are 'never' (default), 'always', and 'on-failure'
cache-provider: basic
cache-overwrite-existing: true
# Cache downloaded JDKs in addition to the default directories.
gradle-home-cache-includes: |
caches
notifications
jdks
# Exclude the local build-cache and keyrings from the directories cached.
gradle-home-cache-excludes: |
caches/build-cache-1
caches/keyrings
- name: Build with Gradle
run: |
./gradlew \
-Dorg.gradle.maven.repo.local=.m2-local \
clean checkLegacyAbi build publishToMavenLocal koverXmlReport koverLog
- name: OpenAI Maven Integration Tests
working-directory: ai-mocks-openai/samples/shadow
run: mvn --batch-mode test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v6
if: ${{ !cancelled() }} # always run even if the previous step fails
with:
report_paths: '**/test-results/**/TEST-*.xml'
annotate_only: true
detailed_summary: true
flaky_summary: true
include_empty_in_summary: false
skip_success_summary: true
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: "/home/runner/work/ai-mocks/ai-mocks/build/reports/kover/report.xml"
- name: Upload coverage reports to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: mokksy/ai-mocks
directory: ./build/reports/kover
files: report.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
knit:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ env.JVM_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JVM_VERSION }}
distribution: ${{ env.JVM_DISTRIBUTION }}
- name: 馃悩Setup Gradle
uses: gradle/actions/setup-gradle@263d8fe18eb54ae581bcdc2e263c5a49173958a3
- name: 馃馃ФKnit
run: make knit
dependency-submission:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ env.JVM_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JVM_VERSION }}
distribution: ${{ env.JVM_DISTRIBUTION }}
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@263d8fe18eb54ae581bcdc2e263c5a49173958a3