-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from s-ayush2903/automation
CI: Added CI Script
- Loading branch information
Showing
12 changed files
with
104 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,68 @@ | ||
image: openjdk:8-jdk | ||
|
||
variables: | ||
ANDROID_COMPILE_SDK: "28" | ||
ANDROID_BUILD_TOOLS: "28.0.2" | ||
ANDROID_SDK_TOOLS: "4333796" | ||
ANDROID_COMPILE_SDK: "29" | ||
ANDROID_BUILD_TOOLS: "29.0.1" | ||
ANDROID_SDK_TOOLS: "6514223" | ||
|
||
before_script: | ||
- apt-get --quiet update --yes | ||
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 | ||
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip | ||
- unzip -d android-sdk-linux android-sdk.zip | ||
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null | ||
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null | ||
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null | ||
- export ANDROID_HOME=$PWD/android-sdk-linux | ||
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ | ||
# Setup path as android_home for moving/exporting the downloaded sdk into it | ||
- export ANDROID_HOME="${PWD}/android-home" | ||
- install -d $ANDROID_HOME | ||
|
||
- wget --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip | ||
|
||
# Move to ANDROID_HOME | ||
- pushd $ANDROID_HOME | ||
- unzip -d cmdline-tools cmdline-tools.zip | ||
- popd | ||
- export PATH=$PATH:${ANDROID_HOME}/cmdline-tools/tools/bin/ | ||
|
||
# Nothing fancy here, just checking sdkManager version | ||
- sdkmanager --version | ||
|
||
# Accept all licenses | ||
- yes | sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true | ||
- sdkmanager --sdk_root=${ANDROID_HOME} "platforms;android-${ANDROID_COMPILE_SDK}" | ||
- sdkmanager --sdk_root=${ANDROID_HOME} "platform-tools" | ||
- sdkmanager --sdk_root=${ANDROID_HOME} "build-tools;${ANDROID_BUILD_TOOLS}" | ||
|
||
# Not necessary, but just for surity | ||
- chmod +x ./gradlew | ||
# temporarily disable checking for EPIPE error and use yes to accept all licenses | ||
- set +o pipefail | ||
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses | ||
- set -o pipefail | ||
|
||
# Check linting | ||
lintDebug: | ||
interruptible: true | ||
stage: build | ||
script: | ||
- ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint | ||
|
||
# Make Project | ||
assembleDebug: | ||
interruptible: true | ||
stage: build | ||
script: | ||
- ./gradlew assembleDebug | ||
- 'touch req.json && echo {\"url\":\"$CI_JOB_URL/artifacts/raw/app/build/outputs/apk/debug/app-debug.apk\",\"platform\": \"android\" } > req.json' | ||
artifacts: | ||
paths: | ||
- app/build/outputs/ | ||
- req.json | ||
|
||
# Run all tests, if any fails, interrupt the pipeline(fail it) | ||
debugTests: | ||
interruptible: true | ||
stage: test | ||
script: | ||
- ./gradlew -Pci --console=plain :app:testDebug | ||
- ./gradlew -Pci --console=plain :app:testDebugUnitTest | ||
|
||
# Deployment to appetize.io, go through readme for more info | ||
deploy: | ||
interruptible: true | ||
stage: deploy | ||
dependencies: | ||
- assembleDebug | ||
script: | ||
- 'curl -s -X POST -H "Content-Type: application/json" -d @req.json https://[email protected]/v1/apps/$APPETIZE_KEY > response.json' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# CelestaAndroid2k19 | ||
Android app for Annual technical fest of IIT Patna, Celesta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "", | ||
"project_id": "" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:123456789012:android:1234567890123456", | ||
"android_client_info": { | ||
"package_name": "in.org.celesta.iitp" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "", | ||
"client_type": 3 | ||
}, | ||
{ | ||
"client_id": "", | ||
"client_type": 1, | ||
"android_info": { | ||
"package_name": "in.org.celesta.iitp", | ||
"certificate_hash": "" | ||
} | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "" | ||
} | ||
], | ||
"services": { | ||
"analytics_service": { | ||
"status": 2, | ||
"analytics_property": { | ||
"tracking_id": "" | ||
} | ||
}, | ||
"appinvite_service": { | ||
"status": 1, | ||
"other_platform_oauth_client": [] | ||
}, | ||
"ads_service": { | ||
"status": 1 | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.