Skip to content

Commit 7190516

Browse files
authored
Add github actions script
1 parent 3e96287 commit 7190516

File tree

3 files changed

+43
-27
lines changed

3 files changed

+43
-27
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Kotlin SDK CI with Gradle
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up JDK 11
14+
uses: actions/setup-java@v3
15+
with:
16+
distribution: 'adopt'
17+
java-version: '11'
18+
19+
- name: Prepare Cloudinary URL
20+
id: cloudinary
21+
run: |
22+
CLOUDINARY_URL=$(bash tools/get_test_cloud.sh)
23+
echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV
24+
echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)"
25+
26+
- name: Clean Gradle plugin cache
27+
run: |
28+
rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
29+
rm -fr $HOME/.gradle/caches/*/plugin-resolution/
30+
31+
- name: Cache Gradle
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.gradle/caches
36+
~/.gradle/wrapper
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
38+
restore-keys: |
39+
${{ runner.os }}-gradle-
40+
41+
- name: Run tests
42+
run: ./gradlew clean test

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

tools/allocate_test_cloud.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ SDK_NAME="${1}"
66

77
CLOUD_DETAILS=$(curl -sS -d "{\"prefix\" : \"${SDK_NAME}\"}" "${API_ENDPOINT}")
88

9-
echo ${CLOUD_DETAILS} | python -c 'import json,sys;c=json.load(sys.stdin)["payload"];print("cloudinary://%s:%s@%s" % (c["cloudApiKey"], c["cloudApiSecret"], c["cloudName"]))'
9+
echo ${CLOUD_DETAILS} | python3 -c 'import json,sys;c=json.load(sys.stdin)["payload"];print("cloudinary://%s:%s@%s" % (c["cloudApiKey"], c["cloudApiSecret"], c["cloudName"]))'

0 commit comments

Comments
 (0)