-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
186 lines (160 loc) · 6.2 KB
/
Copy pathci.yml
File metadata and controls
186 lines (160 loc) · 6.2 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: CI Pipeline
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
# Least privilege by default; each job widens only what it needs.
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
JAVA_VERSION: '17'
JAVA_DISTRIBUTION: 'temurin'
jobs:
gradle_check:
name: Gradle Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # required by the git-changelog / version derivation
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Run Gradle Check
run: ./gradlew check --no-daemon
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v5
with:
name: test-reports-${{ matrix.os }}
path: |
build/reports/
build/test-results/
retention-days: 7
if-no-files-found: ignore
maven_verify:
name: Maven Verify (${{ matrix.os }})
needs: gradle_check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# windows-latest disabled: see #<issue> — record the reason, not just the comment
os: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: 'maven'
- name: Run Maven Verify
run: mvn --batch-mode --no-transfer-progress verify
gradle_publish:
name: Gradle Publish (Maven Central)
needs: [ gradle_check, maven_verify ]
if: github.ref == 'refs/heads/master' && github.repository == 'JSQLParser/JSqlParser'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish with Gradle
# Gradle only picks up a secret as a project property when it is exported with the
# ORG_GRADLE_PROJECT_ prefix. Plain `ossrhUsername: ...` was an ordinary environment
# variable that nothing ever read.
#
# No RELEASE variable here on purpose: getVersion() then produces a -SNAPSHOT version and
# the plugin routes it to the Central Portal snapshot repository. Set RELEASE=true only
# when you actually intend to cut a release.
run: ./gradlew publishToMavenCentral --no-daemon
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
deploy_docs:
name: Build & Deploy Sphinx Docs
needs: [ gradle_check, maven_verify ]
if: github.ref == 'refs/heads/master' && github.repository == 'JSQLParser/JSqlParser'
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # gitChangelogTask needs full history
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
# cache: 'pip' needs a dependency file to key on. setup-python only looks for
# **/requirements.txt or **/pyproject.toml by default, neither of which exists in this
# repo — hence "No file ... matched". cache-dependency-path points it at the file we keep.
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: '.github/requirements-docs.txt'
# Only xsltproc comes from apt. `sphinx-common` used to be installed here as well; it
# pulled in python3-sphinx / python3-docutils / python3-pil from the runner's stale apt
# index (hence the 404 on python3-pil 10.2.0-1ubuntu1.2) and shadowed the pip-installed
# Sphinx that actually knows about manticore_sphinx_theme. `apt-get update` first, because
# the pre-baked index on the runner image is regularly older than the mirror.
- name: Install XSLT processor
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends xsltproc
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r .github/requirements-docs.txt
- name: Build Sphinx documentation with Gradle
env:
FLOATING_TOC: 'false'
run: ./gradlew -DFLOATING_TOC=false --no-daemon gitChangelogTask renderRR xslt xmldoc sphinx
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: 'build/sphinx'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5