-
Notifications
You must be signed in to change notification settings - Fork 516
175 lines (154 loc) · 5.5 KB
/
PR.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
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
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@v4
- uses: actions/setup-java@v4
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
matrix:
os: [ macOS-14, 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-14
job: instrumentation
runs-on: ${{matrix.os}}
permissions:
contents: read
steps:
# https://github.com/actions/runner-images/issues/10511
# We only use Xcode 15.4, the default version
- name: Remove unused Xcode installations
run: |
df -hI /dev/disk3s1s1
find /Applications -type d -name "Xcode_*.app" | grep -v "Xcode_15.4.app" | xargs sudo rm -rf
df -hI /dev/disk3s1s1
if: matrix.os == 'macOS-14'
- name: Checkout the repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
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 --stacktrace -x linuxX64Test -x dokkaHtml
- name: Run gradle plugin tests
if: matrix.os == 'macOS-14' && matrix.job == 'gradle-plugin-tests'
run: ./gradlew :sqldelight-gradle-plugin:test :sqldelight-gradle-plugin:grammarkitTest --parallel -x dokkaHtml
- name: Run the IntelliJ plugin
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
run: ./gradlew :sqldelight-idea-plugin:build --stacktrace -x dokkaHtml
# Windows tests
- name: Run windows tests
if: matrix.os == 'windows-latest'
run: ./gradlew mingwX64Test sqldelight-idea-plugin:check --stacktrace
- name: Run linux tests
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
# not parallel otherwise NativeTransacterTest fails.
run: ./gradlew linuxX64Test --no-parallel -x dokkaHtml
# 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@v2
with:
api-level: 30
arch: x86
target: aosp_atd
profile: Nexus One
disk-size: 2048M
script: ./gradlew connectedCheck :sqldelight-gradle-plugin:instrumentationTest --stacktrace --parallel -x dokkaHtml
# ios tests
- name: Run ios tests
if: matrix.os == 'macOS-14' && matrix.job == 'test'
run: ./gradlew iosX64Test --stacktrace --parallel
- name: Check for changed files
run: test -z "$(git status --porcelain)"
verify_intellij:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
# https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
idea:
- '2023.2.5' # IC / Iguana
- '2024.1' # IC
- '2024.2' # IC
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
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-14
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- uses: gradle/actions/setup-gradle@v4
with:
cache-cleanup: always
- run: ./gradlew -p sample build --stacktrace --parallel
buildWebSample:
runs-on: macos-14
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version-file: .github/workflows/.ci-java-version
- uses: gradle/actions/setup-gradle@v4
with:
cache-cleanup: always
- run: ./gradlew -p sample-web kotlinUpgradeYarnLock build --stacktrace --parallel
env:
GRADLE_OPTS: -Dorg.gradle.caching=true