Skip to content

Commit

Permalink
Merge branch 'develop' into feature/macgills/detekt
Browse files Browse the repository at this point in the history
# Conflicts:
#	.travis.yml
  • Loading branch information
macgills committed Feb 14, 2020
2 parents 80c3276 + fe5a94f commit d743430
Show file tree
Hide file tree
Showing 322 changed files with 9,370 additions and 2,924 deletions.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: kiwix # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand All @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://kiwix.org/support-us/
custom: # https://kiwix.org/support-us/
41 changes: 41 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Coverage Reporting

on:
push:
branches:
- master
- develop

pull_request:
branches:
- '**'

jobs:

coverageReport:
strategy:
matrix:
api-level: [21, 29]
fail-fast: false
runs-on: macOS-latest
steps:
- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: create instrumentation coverage
uses: reactivecircus/[email protected]
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
script: bash instrumentation.sh

- name: create unit coverage
run: ./gradlew jacocoTestDebugUnitTestReport jacocoTestCustomExampleDebugUnitTestReport

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
62 changes: 62 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Nightly

on:
schedule:
# every night at midnight
- cron: '0 0 * * *'

jobs:

instrumentation_tests:
strategy:
matrix:
api-level: [21, 22, 23, 24, 25, 27, 28, 29]
fail-fast: false
runs-on: macOS-latest
steps:

- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: run instrumentation tests
uses: reactivecircus/[email protected]
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
script: ./gradlew connectedDebugAndroidTest

unit_test_and_release:
runs-on: ubuntu-latest
steps:

- name: checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: run unit tests
run: ./gradlew testDebugUnitTest testCustomExampleDebugUnitTest

- name: build debug
run: ./gradlew assembleDebug

- name: Decrypt files
env:
ssh_key: ${{ secrets.ssh_key }}
run: |
echo "$ssh_key" | base64 -d > ssh_key
chmod 600 ssh_key
- name: Set date variable
run: echo ::set-env name=DATE::$(echo $(date +%Y-%m-%d))

- name: release debug to kiwix.download.org
env:
UNIVERSAL_DEBUG_APK: app/build/outputs/apk/debug/*universal*.apk
run: |
mkdir $DATE
cp $UNIVERSAL_DEBUG_APK $DATE
scp -vrp -i ssh_key -o StrictHostKeyChecking=no $DATE [email protected]:/data/download/nightly/
29 changes: 29 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull requests

on: [pull_request]

jobs:

staticAnalysis:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Static Analysis
run: ./gradlew ktlintCheck detekt app:lintDebug core:lintDebug custom:lintCustomexampleDebug

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Build all configurations
run: ./gradlew assemble
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish App

on:
push:
branches-ignore:
- '*'
- '*/**'
tags:
- '*'
- '*/**'

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Decrypt files
env:
keystore: ${{ secrets.keystore }}
google_json: ${{ secrets.google_json }}
ssh_key: ${{ secrets.ssh_key }}
run: |
echo "$google_json" | base64 -d > google.json
echo "$keystore" | base64 -d > kiwix-android.keystore
echo "$ssh_key" | base64 -d > ssh_key
chmod 600 ssh_key
- name: Set tag variable
run: echo ::set-env name=TAG::$(echo ${GITHUB_REF:10})

- name: Publish app to play store
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
run: ./gradlew publishReleaseApk

- name: Publish app to download.kiwix.org
env:
UNIVERSAL_RELEASE_APK: app/build/outputs/apk/release/*universal*.apk
run: |
cp $UNIVERSAL_RELEASE_APK kiwix-${TAG}.apk
scp -vrp -i ssh_key -o StrictHostKeyChecking=no kiwix-${TAG}.apk [email protected]:/data/download/release/kiwix-android/
- name: Publish to github releases
uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/apk/release/**"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: true
101 changes: 0 additions & 101 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.1.3
BUGFIX: Correct logic for selected book tags
BUGFIX: Crash when searching content via selected text in browser
BUGFIX: Night mode videos were inverted when fullscreened
BUGFIX: Search widget unresponsive

3.1.0
NEW: Revamped Night Mode
NEW: Books unsupported by file system are greyed out
Expand Down
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and community a harassment-free experience for everyone regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:
Examples of behavior that contribute to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ The default build is `debug`, with this variant you can use a debugger while dev

By default we fetch kiwix-lib, the key component for interacting with ZIM files from maven, but if you wish to use your own locally compiled version for testing purposes, then you can create the directory `app/libs` and place your .aar file inside it to have it used instead.

### Linting

PR should be linted properly locally. The linter is a git hooks and always run automatically.

If you have a good reason to ignore it, please run:
```bash
git commit --no-verify
```

### Testing

Unit tests are located in `[module]/src/test` and to run them locally you
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ with additional meta-data. This is the version for Android.
Kiwix Android is written in [Kotlin](https://kotlinlang.org/) (with a few old
pieces in Java).

[![Build Status](https://travis-ci.com/kiwix/kiwix-android.svg?branch=develop)](https://travis-ci.com/kiwix/kiwix-android)
[![Build Status](https://github.com/kiwix/kiwix-android/workflows/CI/badge.svg?query=branch%3Adevelop+workflow%3ANightly)](https://github.com/kiwix/kiwix-android/actions?query=workflow%3ANightly+branch%3Adevelop)
[![codecov](https://codecov.io/gh/kiwix/kiwix-android/branch/develop/graph/badge.svg)](https://codecov.io/gh/kiwix/kiwix-android)
[![CodeFactor](https://www.codefactor.io/repository/github/kiwix/kiwix-android/badge)](https://www.codefactor.io/repository/github/kiwix/kiwix-android)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
Expand Down Expand Up @@ -44,7 +44,7 @@ If you are interested in our custom apps they have their own repo [kiwix-android
- [Butterknife](https://jakewharton.github.io/butterknife/) - View "injection" library for Android
- [Mockito](https://github.com/mockito/mockito) - Most popular Mocking framework for unit tests written in Java
- [RxJava](https://github.com/ReactiveX/RxJava) - Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
- [ObjectBox](https://github.com/objectbox/objectbox-java) - Reactive NoSQL Databse to replace SquiDb
- [ObjectBox](https://github.com/objectbox/objectbox-java) - Reactive NoSQL Databse
- [MockK](https://github.com/mockk/mockk) - Kotlin mocking library that allows mocking of final classes by default.
- [JUnit5](https://github.com/junit-team/junit5/) - The next generation of JUnit
- [AssertJ](https://github.com/joel-costigliola/assertj-core) - Fluent assertions for test code
Expand Down
9 changes: 6 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply(from = rootProject.file("jacoco.gradle"))
ext {
set("versionMajor", 3)
set("versionMinor", 1)
set("versionPatch", 0)
set("versionPatch", 3)
}

fun generateVersionName() = "${ext["versionMajor"]}.${ext["versionMinor"]}.${ext["versionPatch"]}"
Expand All @@ -34,12 +34,12 @@ fun generateVersionCode() =
((ext["versionMinor"] as Int) * 100) +
ext["versionPatch"] as Int

val buildNumber get() = System.getenv("TRAVIS_BUILD_NUMBER") ?: "dev"
val apkPrefix get() = System.getenv("TAG") ?: "dev"

android {

defaultConfig {
base.archivesBaseName = buildNumber
base.archivesBaseName = apkPrefix
resValue("string", "app_name", "Kiwix")
resValue("string", "app_search_string", "Search Kiwix")
versionCode = generateVersionCode()
Expand All @@ -54,6 +54,9 @@ android {

getByName("release") {
buildConfigField("boolean", "KIWIX_ERROR_ACTIVITY", "true")
if (properties.containsKey("disableSigning")) {
signingConfig = null
}
}
}

Expand Down
Loading

0 comments on commit d743430

Please sign in to comment.