Skip to content

Commit ba990be

Browse files
committed
Add CI (github and codecov) from branch Issue#19
1 parent f7f6d56 commit ba990be

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.codecov.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
threshold: 0.1%
10+
patch:
11+
default:
12+
target: 100%
13+
threshold: 20%

.github/workflows/pull_request.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Pull requests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
10+
build_job:
11+
name: Build Pull Request
12+
runs-on: ubuntu-18.04
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 11
23+
24+
- name: Build Project
25+
run: bash contrib/build.sh
26+
27+
- name: Compile Project
28+
run: |
29+
cd android-libkiwixbuild
30+
./gradlew androidSourcesJar build
31+
32+
- name: create unit coverage
33+
run: |
34+
cd android-libkiwixbuild
35+
./gradlew createCodeCoverageReport
36+
37+
- name: Upload coverage to Codecov
38+
uses: codecov/codecov-action@v2
39+
40+
- name: Upload Coverage to GH-Actions
41+
uses: actions/[email protected]
42+
if: ${{ always() }}
43+
with:
44+
name: Tests Coverage Report
45+
path: |
46+
android-libkiwixbuild/build/coverage-report/

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build Java-LibKiwix
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- '*'
7+
- '*/**'
8+
tags:
9+
- '*'
10+
- '*/**'
11+
12+
jobs:
13+
publish:
14+
15+
runs-on: ubuntu-18.04
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 1
21+
22+
- name: Set up JDK 11
23+
uses: actions/setup-java@v2
24+
with:
25+
distribution: adopt
26+
java-version: 11
27+
28+
- name: Building Project
29+
run: bash contrib/build.sh
30+
31+
- name: Release build
32+
run: |
33+
cd android-libkiwixbuild
34+
./gradlew assemble
35+
36+
- name: Genrate Source jar
37+
run: |
38+
cd android-libkiwixbuild
39+
./gradlew androidSourcesJar
40+
41+
- name: Publish to MavenCentral
42+
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
43+
env:
44+
ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
45+
ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
46+
signing.keyId: ${{ secrets.SIGNING_KEY_ID }}
47+
siging.password: ${{ secrets.SIGNING_PASSWORD }}
48+
siging.key: ${{ secrets.SIGNING_KEY }}
49+
sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

0 commit comments

Comments
 (0)