Repository navigation
228 lines (208 loc) · 8.79 KB
/
Copy pathPR.yml
File metadata and controls
228 lines (208 loc) · 8.79 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Test
on:
pull_request:
# Ensure paths-ignore match paths in PR-skip.yml
paths-ignore:
- 'docs/**'
- '*.md'
- 'mkdocs.yml'
jobs:
spotless:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- run: ./gradlew spotlessCheck
build:
strategy:
# Ensure any changes to the matrix are also made in PR-skip.yml
fail-fast: false
matrix:
os: [ macOS-15, windows-latest, ubuntu-latest ]
job: [ instrumentation, test, gradle-plugin-tests ]
exclude:
- os: windows-latest
job: instrumentation
- os: windows-latest
job: gradle-plugin-tests
- os: ubuntu-latest
job: gradle-plugin-tests
- os: macOS-15
job: instrumentation
runs-on: ${{matrix.os}}
permissions:
contents: read
steps:
# https://github.com/actions/runner-images/issues/10511 macOS image can run out of diskspace
# We only use Xcode 16.4, the default version, delete others to reclaim diskspace
- name: Remove unused Xcode installations
run: |
df -hI /System/Volumes/Data
find /Applications -maxdepth 1 -type d -name "Xcode_*.app" \
| grep -vF "Xcode_16.4.app" \
| xargs -I{} sh -c 'echo "Removing {}"; sudo rm -rf "{}"'
sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
xcode-select -p
df -hI /System/Volumes/Data
if: matrix.os == 'macOS-15'
- name: Reclaim disk-space on ubuntu
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
df -h
if: matrix.os == 'ubuntu-latest'
- name: Checkout the repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Java
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- name: Setup gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
cache-disabled: true
# Linux tests
- name: Run gradle tests
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
run: |
./gradlew build -x :sqldelight-idea-plugin:build -x :sqldelight-gradle-plugin:test -x linuxX64Test -x dokkaGeneratePublicationHtml
- name: Run gradle plugin tests
if: matrix.os == 'macOS-15' && matrix.job == 'gradle-plugin-tests'
run: ./gradlew :sqldelight-gradle-plugin:test :sqldelight-gradle-plugin:grammarkitTest --parallel -x dokkaGeneratePublicationHtml
- name: Run the IntelliJ plugin
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
run: ./gradlew :sqldelight-idea-plugin:build -x dokkaGeneratePublicationHtml
# Windows tests
- name: Run windows tests
if: matrix.os == 'windows-latest'
run: ./gradlew mingwX64Test sqldelight-idea-plugin:check
- name: Run linux tests
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
# not parallel otherwise NativeTransacterTest fails.
run: ./gradlew linuxX64Test --no-parallel -x dokkaGeneratePublicationHtml
env:
GRADLE_OPTS: ${{env.GRADLE_OPTS}} -Dorg.gradle.jvmargs="${{env.JAVA_OPTS_ubuntu-latest}}"
# android tests
- name: Enable KVM group perms
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Run instrumentation tests
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0
with:
api-level: 30
arch: x86
target: aosp_atd
profile: Nexus One
disk-size: 2048M
script: ./gradlew :sqldelight-gradle-plugin:instrumentationTest --parallel -x dokkaGeneratePublicationHtml
# ios tests
- name: Run ios tests
if: matrix.os == 'macOS-15' && matrix.job == 'test'
run: ./gradlew iosSimulatorArm64Test --parallel
- name: Check for changed files
run: test -z "$(git status --porcelain)"
verify_intellij:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
idea:
- '2023.3.1' # IC / Jellyfish
- '2026.2' # IC
# - '2024.2' # IC - This is failing trying to get the android plugin dependency for unknown reasons.
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- run: ./gradlew -DideaVersion=${{matrix.idea}} :sqldelight-idea-plugin:verifyPlugin
verify_intellij_check:
runs-on: ubuntu-latest
needs: verify_intellij
steps:
- name: Success!
run: echo "All IntelliJ plugin verification checks passed!"
buildSample:
runs-on: macos-26
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
cache-cleanup: always
- run: ./gradlew -p sample build --parallel
buildWebSample:
runs-on: macos-26
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
cache-cleanup: always
- run: ./gradlew -p sample-web kotlinUpgradeYarnLock build --parallel
docs_verify:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout the repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Java
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- name: Setup gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
with:
cache-cleanup: always
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.14
- name: Get Docs Version
id: version
run: cat gradle.properties | grep --color=never VERSION_NAME >> $GITHUB_OUTPUT
- name: Prep mkdocs
run: |
pip3 install --no-deps -r .github/workflows/requirements.txt
.github/workflows/prepare_mkdocs.sh ${{ steps.version.outputs.VERSION_NAME }}
- name: Configure git for mike (no push)
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git fetch origin gh-pages --depth=1 || true
- name: Validate SNAPSHOT deploy (no push)
if: ${{ contains(steps.version.outputs.VERSION_NAME, 'SNAPSHOT') }}
env:
SQLDELIGHT_VERSION: ${{ steps.version.outputs.VERSION_NAME }}
run: mike deploy -u ${{ steps.version.outputs.VERSION_NAME }} snapshot
- name: Ensure working tree clean
run: test -z "$(git status --porcelain)" || (echo "mike produced uncommitted changes" && git status && exit 1)
env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.daemon=false -Dorg.gradle.vfs.watch=false -Dorg.gradle.logging.stacktrace=full
JAVA_OPTS_ubuntu-latest: -Xmx12g -Xms4g -XX:MaxMetaspaceSize=4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8