-
Notifications
You must be signed in to change notification settings - Fork 2
161 lines (145 loc) · 5.37 KB
/
publish.yaml
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
# Copied from coil
name: CI
on:
push:
tags:
- 'v*.*.*'
branches:
- main
pull_request:
concurrency:
# Limit concurrency to 1 for PRs. 'main' concurrency isn't limited.
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CI: true
JAVA_VERSION: 17
ORG_GRADLE_IDE_DOWNLOADJAVADOC: false
ORG_GRADLE_IDE_DOWNLOADSOURCES: false
jobs:
checks:
name: Checks
runs-on: macos-latest
timeout-minutes: 30
if: false # https://github.com/Kotlin/binary-compatibility-validator/issues/261
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Check Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
# - name: Check style
# run: ./gradlew spotlessCheck
- name: Check lint
run: ./gradlew lint
- name: Check binary compatibility
run: ./gradlew apiCheck || { exit_code=$?; printf "*** This PR changes Inspektor's public API. If this change is intentional, run './gradlew apiDump' and commit the new API files. ***"; exit $exit_code; }
unit-tests:
name: Unit tests
runs-on: macos-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v4
continue-on-error: true
timeout-minutes: 5
with:
cache-overwrite-existing: true
gradle-home-cache-cleanup: true
- name: Remove unused Xcode versions
if: false
run: |
echo "Currently installed Xcode versions:"
find /Applications -name "Xcode*" -maxdepth 1 -mindepth 1
echo "Removing all except the currently selected Xcode version..."
ls -d /Applications/Xcode* | grep -v "$(xcode-select -p | sed 's:/Contents/Developer::')" | xargs -P 3 -I {} sudo rm -rf "{}"
echo "Available Xcode versions after removal:"
find /Applications -name "Xcode*" -maxdepth 1 -mindepth 1
- name: Unit tests
run: ./gradlew :inspektor:jvmTest
instrumentation-tests:
name: Instrumentation tests
if: false
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
api-level: [ 22, 26, 31 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v4
continue-on-error: true
timeout-minutes: 5
with:
cache-overwrite-existing: true
gradle-home-cache-cleanup: true
# API 30+ emulators only have x86_64 system images.
- name: Get AVD info
uses: ./.github/actions/get-avd-info
id: avd-info
with:
api-level: ${{ matrix.api-level }}
- name: Enable KVM
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: Instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.avd-info.outputs.arch }}
target: ${{ steps.avd-info.outputs.target }}
script: mv .github/debug.keystore ~/.android; ./gradlew connectedDebugAndroidTest
build-sample:
name: Build sample
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v4
continue-on-error: true
timeout-minutes: 5
with:
cache-overwrite-existing: true
gradle-home-cache-cleanup: true
- name: Build Compose and View sample
run: ./gradlew sample:assembleDebug
- name: Build iOS app
run: xcodebuild -project iosApp/iosApp.xcodeproj -scheme iosApp -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest'
deploy-snapshot:
name: Deploy
runs-on: macos-latest
timeout-minutes: 60
if: github.repository == 'ShreyashKore/inspektor' && startsWith(github.ref, 'refs/tags/v')
# needs: [ checks, unit-tests, instrumentation-tests, build-sample ]
needs: [ unit-tests, build-sample ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
- name: Deploy
env:
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache