Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nuhkoca committed Apr 6, 2020
1 parent be48c0d commit aeb801b
Show file tree
Hide file tree
Showing 218 changed files with 11,687 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# http://editorconfig.org
root = true

# noinspection EditorConfigKeyCorrectness
[*.{kt, kts}]
indent_size = 4
indent_style = space
continuation_indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8
# Disabling rules that were added in the latest versions of ktlint
disabled_rules = import-ordering, experimental:indent

[gradlew.bat]
end_of_line = crlf

[*.md]
trim_trailing_whitespace = false
16 changes: 16 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.
# Not adding in this PR, but I'd like to try adding a global owner set with the entire team.
# One interpretation of their docs is that global owners are added only if not removed
# by a more local rule.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
* @nuhkoca
6 changes: 6 additions & 0 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx5120m
org.gradle.workers.max=2
kotlin.incremental=false
kotlin.compiler.execution.strategy=in-process
139 changes: 139 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Libbra

on:
push:
branches:
- master

pull_request:
branches:
- master

types: [opened, synchronize]

env:
CI: true

jobs:
setup:
name: Setup
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Ensure .gradle/caches is empty before writing to it.
# This helps us stay within Github's cache size limits.
- name: Clean Cache
run: rm -rf ~/.gradle/caches

- name: Install JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Check Dependency Updates
run: ./gradlew dependencyUpdates -Drevision=release

# Restore the cache.
# Intentionally don't set 'restore-keys' so the cache never contains redundant dependencies.
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} }}

check-style:
needs: setup
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Restore the cache.
# Intentionally don't set 'restore-keys' so the cache never contains redundant dependencies.
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} }}

- name: Run Lint
run: ./gradlew lintDebug

- name: Run Ktlint
run: ./gradlew ktlintCheck

- name: Run Detekt
run: ./gradlew detekt

- name: Run Spotless
run: ./gradlew spotlessCheck

- name: Upload Reports
uses: actions/upload-artifact@v1
if: failure()
with:
name: reports
path: app/build/reports

build:
needs: check-style
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Restore the cache.
# Intentionally don't set 'restore-keys' so the cache never contains redundant dependencies.
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} }}

- name: Create Build Report
uses: eskatos/gradle-command-action@v1
with:
arguments: assembleDebug --scan
failOnError: true
id: gradle

- name: Upload Sample Artifacts
uses: actions/upload-artifact@v1
if: always()
with:
name: apk
path: app/build/outputs/apk/

- name: Publish Build Report As Comment If Failure
uses: mshick/add-pr-comment@v1
if: failure()
with:
message: Build failed ${{ steps.gradle.outputs.build-scan-url }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false

test:
needs: build
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Restore the cache.
# Intentionally don't set 'restore-keys' so the cache never contains redundant dependencies.
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} }}

- name: Unit Tests
run: ./gradlew testDebugUnitTest :rules:test # lint tests requires this task

- name: Instrumentation Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
script: ./gradlew connectedDebugAndroidTest
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
12 changes: 12 additions & 0 deletions .lint/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>

<issue id="VectorPath" severity="ignore" />
<issue id="VectorRaster" severity="ignore" />

<!-- Suppress lint warnings for generated classes -->
<issue id="all">
<ignore path="**/build" />
</issue>

</lint>
Loading

0 comments on commit aeb801b

Please sign in to comment.