forked from yigit/kotlin-sqlite-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (130 loc) · 4.6 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
# Allow precise monitoring of the save/restore of Gradle User Home by `gradle-build-action`
# See https://github.com/marketplace/actions/gradle-build-action?version=v2.1.1#cache-debugging-and-analysis
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup machine
uses: ./.github/actions/commonSetup
with:
gradleCacheKey: ${{ secrets.GCP_ACCOUNT }}
gradleCachePush: true
- name: build and test
id: gradle-build-and-test
run: ./gradlew allTests --stacktrace --scan
env:
GRADLE_CACHE_KEY: ${{ secrets.GCP_ACCOUNT }}
GRADLE_CACHE_PUSH: true
- name: Build Scan for Test
shell: bash
run: echo "::notice title=Build and Test scan::${{ steps.gradle-build-and-test.outputs.build-scan-url }}"
- name: run spotless on build plugin
run: ./gradlew -p buildPlugin spotlessCheck --stacktrace
env:
GRADLE_CACHE_KEY: ${{ secrets.GCP_ACCOUNT }}
GRADLE_CACHE_PUSH: true
- name: run spotless
run: ./gradlew spotlessCheck --stacktrace
env:
GRADLE_CACHE_KEY: ${{ secrets.GCP_ACCOUNT }}
GRADLE_CACHE_PUSH: true
- name: stop daemon
run: ./gradlew --stop
- name: build dist
id: gradle-build-dist
run: ./gradlew buildOnServer packageDebugAndroidTest --stacktrace --scan
env:
GRADLE_CACHE_KEY: ${{ secrets.GCP_ACCOUNT }}
GRADLE_CACHE_PUSH: true
- name: Build Scan for Dist
shell: bash
run: echo "::notice title=Dist Scan::${{ steps.gradle-build-dist.outputs.build-scan-url }}"
- name: Upload test results for sqlitebindings
if: always()
uses: actions/upload-artifact@v2
with:
name: sqlitebindings-test-reports
path: sqlitebindings/build/reports
- name: Upload test results for ksqlite3
if: always()
uses: actions/upload-artifact@v2
with:
name: ksqlite3-test-reports
path: ksqlite3/build/reports
- name: Upload JNI failures
if: always()
uses: actions/upload-artifact@v2
with:
name: ksqlite3-jni-errors
path: ksqlite3/hs_err*
- name: Upload Dist
if: always()
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-dist
path: build/dist
- name: Upload apks
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: test apks of ${{ runner.os }}
path: ./**/*.apk
buildFinalArtifacts:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup machine
uses: ./.github/actions/commonSetup
with:
gradleCacheKey: ${{ secrets.GCP_ACCOUNT }}
gradleCachePush: true
# ubuntu-latest, macos-latest, windows-latest -> should match the strategies of build
- name: Download linux dist
uses: actions/download-artifact@v2
with:
name: ubuntu-latest-dist
path: artifacts/linux
- name: Download mac dist
uses: actions/download-artifact@v2
with:
name: macos-latest-dist
path: artifacts/mac
- name: Download windows dist
uses: actions/download-artifact@v2
with:
name: windows-latest-dist
path: artifacts/windows
- name: test and publish
id: gradle-test-and-dist
run: DIST_OUTPUTS=artifacts ./gradlew jvmTest createCombinedRepo --info --stacktrace --scan
env:
GRADLE_CACHE_KEY: ${{ secrets.GCP_ACCOUNT }}
GRADLE_CACHE_PUSH: true
- name: Build Dist And Test Scan
shell: bash
run: echo "::notice title=Build and Dist Scan::${{ steps.gradle-test-and-dist.outputs.build-scan-url }}"
- name: Upload Repo
uses: actions/upload-artifact@v2
with:
name: combined-repo
path: build/dist/combinedRepo