Skip to content

Commit 9cb476f

Browse files
Migrate to GitHub Actions
1 parent 9afff31 commit 9cb476f

File tree

4 files changed

+64
-15
lines changed

4 files changed

+64
-15
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
scala-version: ['2.11.8', '2.12.8']
11+
java-version: ['8']
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK ${{ matrix.java-version }}
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: ${{ matrix.java-version }}
21+
distribution: 'temurin'
22+
23+
- name: Cache SBT dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.ivy2/cache
28+
~/.sbt
29+
~/.coursier/cache
30+
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/build.properties', 'project/plugins.sbt') }}
31+
restore-keys: |
32+
${{ runner.os }}-sbt-
33+
34+
- name: Install jq
35+
run: sudo apt-get update && sudo apt-get install -y jq
36+
37+
- name: Set CLOUDINARY_URL
38+
run: |
39+
export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh)
40+
echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)"
41+
echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV
42+
43+
- name: Run tests
44+
run: sbt ++${{ matrix.scala-version }} test
45+
env:
46+
CLOUDINARY_URL: ${{ env.CLOUDINARY_URL }}

.travis.yml

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

tools/allocate_test_cloud.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
API_ENDPOINT="https://sub-account-testing.cloudinary.com/create_sub_account"
4+
5+
SDK_NAME="${1}"
6+
7+
CLOUD_DETAILS=$(curl -sS -d "{\"prefix\" : \"${SDK_NAME}\"}" "${API_ENDPOINT}")
8+
9+
echo ${CLOUD_DETAILS} | jq -r '.payload | "cloudinary://\(.cloudApiKey):\(.cloudApiSecret)@\(.cloudName)"'

tools/get_test_cloud.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4+
5+
SCALA_VER=$(grep 'scalaVersion' ${DIR}/../project/Common.scala | grep -o '"[0-9][^"]*"' | head -n 1 | tr -d '"');
6+
SDK_VER=$(grep -o '"[0-9][^"]*"' ${DIR}/../project/Common.scala | head -n 1 | tr -d '"')
7+
8+
9+
bash ${DIR}/allocate_test_cloud.sh "Scala ${SCALA_VER} SDK ${SDK_VER}"

0 commit comments

Comments
 (0)