-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from AckeeCZ/chore/ci-and-docs
Add CI and documentation
- Loading branch information
Showing
22 changed files
with
556 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This action's steps must be synced with preMergeRequestCheck Gradle task's checks to ensure that | ||
# we check required stuff on CI and at the same time developers can run the Gradle task to verify their | ||
# changes before making a PR. This action can be used in more workflows than just PR, since these | ||
# basic pre merge request checks (Detekt, library tests, ...) are fundamental to be checked in | ||
# basically all situations like merging, pushing to dev, etc. | ||
name: Basic preflight check | ||
description: Action that contains basic checks like running Detekt or library tests that are common to multiple workflows | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Detekt | ||
shell: bash | ||
run: ./gradlew detekt | ||
|
||
- name: Assemble release variant | ||
shell: bash | ||
# Exclude sample app module from build. It requires the library artifacts to be published. | ||
run: ./gradlew assembleRelease -x :app:assembleRelease | ||
|
||
- name: Library tests | ||
shell: bash | ||
run: ./gradlew testDebugUnitTest -x :app:testDebugUnitTest | ||
|
||
- name: Binary compatibility check | ||
shell: bash | ||
run: ./gradlew apiCheck | ||
|
||
- name: Build logic tests | ||
shell: bash | ||
run: ./gradlew build-logic:logic:test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Setup | ||
description: Action that performs common setup tasks like setting up Java | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
# Gradle build logic relies on this tag format, so if you need to change it, you need to change | ||
# it there as well. | ||
- bom-* | ||
|
||
env: | ||
GPG_KEY: ${{ secrets.ANDROID_GPG_KEY }} | ||
GPG_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} | ||
MAVEN_USERNAME: ${{ secrets.ANDROID_MAVEN_CENTRAL_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.ANDROID_MAVEN_CENTRAL_PASSWORD }} | ||
|
||
jobs: | ||
# This job's steps must be synced with prePublishCheck Gradle task's checks to ensure that | ||
# we check required stuff on CI and at the same time developers can run the Gradle task to verify | ||
# their changes before publishing. | ||
preflight_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup | ||
- uses: ./.github/actions/basic-preflight-check | ||
|
||
- name: Verify publishing | ||
run: ./gradlew verifyPublishing | ||
|
||
- name: Verify BOM version | ||
run: ./gradlew verifyBomVersion | ||
|
||
- name: Artifacts tests | ||
# We need to publish the latest versions to Maven local first before we can run tests | ||
# on published artifacts | ||
run: | | ||
./gradlew publishToMavenLocal \ | ||
-PsigningInMemoryKey=$GPG_KEY \ | ||
-PsigningInMemoryKeyPassword=$GPG_PASSWORD \ | ||
-PmavenCentralUsername=$MAVEN_USERNAME \ | ||
-PmavenCentralPassword=$MAVEN_PASSWORD | ||
./gradlew :app:testDebugUnitTest | ||
publish: | ||
needs: preflight_check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- name: Publish to Maven Central | ||
run: | | ||
./gradlew --stacktrace publishAndReleaseToMavenCentral \ | ||
-PsigningInMemoryKey=$GPG_KEY \ | ||
-PsigningInMemoryKeyPassword=$GPG_PASSWORD \ | ||
-PmavenCentralUsername=$MAVEN_USERNAME \ | ||
-PmavenCentralPassword=$MAVEN_PASSWORD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Main branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup | ||
- uses: ./.github/actions/basic-preflight-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Pull request | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
pull_request: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup | ||
- uses: ./.github/actions/basic-preflight-check |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres | ||
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
### core | ||
### datastore | ||
### datastore-preferences | ||
### jetpack | ||
|
||
## BOM [1.0.0] - TBD | ||
|
||
### core | ||
#### Added | ||
- First version of the artifact 🎉 | ||
|
||
### datastore | ||
#### Added | ||
- First version of the artifact 🎉 | ||
|
||
### datastore-preferences | ||
#### Added | ||
- First version of the artifact 🎉 | ||
|
||
### jetpack | ||
#### Added | ||
- First version of the artifact 🎉 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This project includes code derived from the Jetpack Security Crypto library, | ||
developed by Google LLC, and licensed under the Apache License 2.0. |
Oops, something went wrong.