108 lines (93 loc) · 3.95 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
name: Test
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
build:
strategy:
matrix:
# always use the oldest ubuntu LTS release still available with the github actions
# this is needed so the build host does not have any libraries installed which are too recent for a successful linking on linux
# for a log of why this is needed, see: https://github.com/touchlab/SQLiter/pull/38#issuecomment-867171789
#
# Windows checks are temporarily disabled until fixed, see: https://github.com/cashapp/sqldelight/issues/2579
os: [ macOS-latest, ubuntu-18.04 ]
job: [ instrumentation, test, gradle-plugin-tests ]
exclude:
- os: windows-latest
job: instrumentation
- os: windows-latest
job: gradle-plugin-tests
runs-on: ${{matrix.os}}
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3.3.0
with:
distribution: 'zulu'
java-version: 11
- name: Setup gradle
uses: gradle/gradle-build-action@v2
with:
cache-disabled: true
# Linux tests
- name: Run gradle tests
if: matrix.os == 'ubuntu-18.04' && 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-18.04' && matrix.job == 'gradle-plugin-tests'
run: ./gradlew :sqldelight-gradle-plugin:test --stacktrace
- name: Run the IntelliJ plugin
if: matrix.os == 'ubuntu-18.04' && matrix.job == 'instrumentation'
run: ./gradlew :sqldelight-idea-plugin:build --stacktrace
- name: Verify IntelliJ plugin
if: matrix.os == 'ubuntu-18.04' && matrix.job == 'instrumentation'
run: ./gradlew :sqldelight-idea-plugin:runPluginVerifier
# 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-18.04'
run: ./gradlew linuxTest
# iOS tests
- 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: Run ios tests with strict memory model
if: matrix.os == 'macOS-latest' && matrix.job == 'test'
run: ./gradlew iosX64Test -Pkotlin.native.binary.memoryModel=strict --stacktrace
# Build the sample
- name: Build the sample
if: matrix.os == 'macOS-latest' && matrix.job == 'gradle-plugin-tests'
uses: gradle/gradle-build-action@v2
with:
arguments: build --stacktrace
build-root-directory: sample
cache-disabled: true
- 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
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: github.repository_owner == 'cashapp' # always run even if the previous step fails if the source is from the cashapp org
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError -XX:MetaspaceSize=1g"