forked from sqldelight/sqldelight
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (120 loc) · 4.29 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
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-latest, 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
runs-on: ${{matrix.os}}
permissions:
contents: read
steps:
- 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/gradle-build-action@v3
with:
gradle-home-cache-cleanup: 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
- name: Run gradle plugin tests
if: matrix.os == 'macOS-latest' && matrix.job == 'gradle-plugin-tests'
run: ./gradlew :sqldelight-gradle-plugin:test :sqldelight-gradle-plugin:grammarkitTest --parallel
- name: Run the IntelliJ plugin
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
run: ./gradlew :sqldelight-idea-plugin:build --stacktrace
# 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'
# not parallel otherwise NativeTransacterTest fails.
run: ./gradlew linuxX64Test --no-parallel
# android tests
- name: Run instrumentation tests
if: matrix.os == 'macOS-latest' && matrix.job == 'instrumentation'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
script: ./gradlew connectedCheck :sqldelight-gradle-plugin:instrumentationTest --stacktrace --parallel
# ios tests
- name: Run ios tests
if: matrix.os == 'macOS-latest' && matrix.job == 'test'
run: ./gradlew iosX64Test --stacktrace --parallel
# Build the samples
- name: Build the mobile sample
if: matrix.os == 'macOS-latest' && matrix.job == 'test'
uses: gradle/gradle-build-action@v3
with:
arguments: build --stacktrace --parallel
build-root-directory: sample
gradle-home-cache-cleanup: true
- name: Build the web sample
if: matrix.os == 'macOS-latest' && matrix.job == 'test'
uses: gradle/gradle-build-action@v3
with:
arguments: kotlinUpgradeYarnLock build --stacktrace --parallel
build-root-directory: sample-web
gradle-home-cache-cleanup: true
verify_intellij:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
# https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
idea:
- 'IC-2022.3.3' # AS: Giraffe | 2022.3.1
- 'IC-2023.1' # IC
- 'IC-2023.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:runPluginVerifier
verify_intellij_check:
runs-on: ubuntu-latest
needs: verify_intellij
steps:
- name: Success!
run: echo "All IntelliJ plugin verification checks passed!"
env:
GRADLE_OPTS: -Dorg.gradle.caching=true