This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (83 loc) · 3.53 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
name: Test
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
build:
strategy:
matrix:
os: [ macOS-latest, windows-latest, ubuntu-latest ]
job: [ instrumentation, test, gradle-plugin-tests, gradle-plugin-integrations ]
exclude:
- os: windows-latest
job: instrumentation
- os: windows-latest
job: gradle-plugin-tests
- os: windows-latest
job: gradle-plugin-integrations
- os: macOS-latest
job: gradle-plugin-integrations
runs-on: ${{matrix.os}}
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Cache gradle
uses: actions/[email protected]
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- 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
- name: Run gradle plugin tests
if: matrix.os == 'ubuntu-latest' && matrix.job == 'gradle-plugin-tests'
run: |
./gradlew :sqldelight-gradle-plugin:test --tests="com.squareup.sqldelight.tests.*"
./gradlew :sqldelight-gradle-plugin:test --tests="com.squareup.sqldelight.properties.*"
- name: Run gradle plugin integrations
if: matrix.os == 'ubuntu-latest' && matrix.job == 'gradle-plugin-integrations'
run: |
./gradlew :sqldelight-gradle-plugin:test --tests="com.squareup.sqldelight.integrations.*"
./gradlew :sqldelight-gradle-plugin:test --tests="com.squareup.sqldelight.dialect.*"
- name: Run the IntelliJ plugin
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
run: ./gradlew :sqldelight-idea-plugin:build --stacktrace
- name: Verify IntelliJ plugin
if: matrix.os == 'ubuntu-latest' && matrix.job == 'instrumentation'
run: |
./gradlew :sqldelight-idea-plugin:runPluginVerifier
- name: Run windows tests
if: matrix.os == 'windows-latest'
run: ./gradlew mingwTest sqldelight-idea-plugin:check --stacktrace
- name: Run instrumentation tests
if: matrix.os == 'macOS-latest' && matrix.job == 'instrumentation'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedCheck :sqldelight-gradle-plugin:build --stacktrace -PInstrumentation
- name: Run ios tests
if: matrix.os == 'macOS-latest' && matrix.job == 'test'
run: ./gradlew iosX64Test --stacktrace
- name: Build the sample
if: matrix.os == 'macOS-latest' && matrix.job == 'gradle-plugin-tests'
run: |
cd sample
./gradlew build
- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- name: Upload the build report
if: failure()
uses: actions/upload-artifact@master
with:
name: error-report
path: build-reports.zip
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -Xms128m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=1024m"