diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..041e447 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,13 @@ +codecov: + notify: + require_ci_to_pass: yes + +coverage: + status: + project: + default: + threshold: 0.1% + patch: + default: + target: 100% + threshold: 20% diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..cc550ed --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,46 @@ +name: Pull requests + +on: + pull_request: + branches: + - '**' + +jobs: + + build_job: + name: Build Pull Request + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Build Project + run: bash contrib/build.sh + + - name: Compile Project + run: | + cd android-libkiwixbuild + ./gradlew androidSourcesJar build + + - name: create unit coverage + run: | + cd android-libkiwixbuild + ./gradlew createCodeCoverageReport + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + + - name: Upload Coverage to GH-Actions + uses: actions/upload-artifact@v2.2.0 + if: ${{ always() }} + with: + name: Tests Coverage Report + path: | + android-libkiwixbuild/build/coverage-report/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cf7fbed --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Build Java-LibKiwix + +on: + push: + branches-ignore: + - '*' + - '*/**' + tags: + - '*' + - '*/**' + +jobs: + publish: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 11 + + - name: Building Project + run: bash contrib/build.sh + + - name: Release build + run: | + cd android-libkiwixbuild + ./gradlew assemble + + - name: Genrate Source jar + run: | + cd android-libkiwixbuild + ./gradlew androidSourcesJar + + - name: Publish to MavenCentral + run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository + env: + ossrhUsername: ${{ secrets.OSSRH_USERNAME }} + ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} + signing.keyId: ${{ secrets.SIGNING_KEY_ID }} + siging.password: ${{ secrets.SIGNING_PASSWORD }} + siging.key: ${{ secrets.SIGNING_KEY }} + sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} \ No newline at end of file