Skip to content

Commit

Permalink
Merge pull request #50 from s-ayush2903/automation
Browse files Browse the repository at this point in the history
CI: Added CI Script
  • Loading branch information
amangrobo authored Jun 23, 2020
2 parents baca62c + c815bba commit 4128c35
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 220 deletions.
13 changes: 1 addition & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,7 @@ captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
.idea

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
Expand Down Expand Up @@ -80,4 +70,3 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
app/google-services.json
58 changes: 43 additions & 15 deletions .gitlab-ci.yml
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'
116 changes: 0 additions & 116 deletions .idea/codeStyles/Project.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

48 changes: 0 additions & 48 deletions .idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/render.experimental.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
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
51 changes: 51 additions & 0 deletions app/google-services.json
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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
}

private void observeAll() {
viewModel.loadAllEvents().observe(this, eventItems -> {
viewModel.loadAllEvents().observe(getViewLifecycleOwner(), eventItems -> {
List<EventItem> newList = new ArrayList<>();
for (EventItem n : eventItems) {
if (n.getEvClub().equals(club)) newList.add(n);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
}

private void observeAll() {
viewModel.loadAllClubs().observe(this, strings -> {
viewModel.loadAllClubs().observe(getViewLifecycleOwner(), strings -> {

List<String> temp = new ArrayList<>();

Expand Down
Loading

0 comments on commit 4128c35

Please sign in to comment.