diff options
| author | Menny Even Danan <menny@evendanan.net> | 2019-10-22 18:51:22 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2019-10-23 01:22:35 +0000 |
| commit | ea50d0a96fd6d0945bbdc911c7ccdb9cee68e58f (patch) | |
| tree | 145f86bbd9604335dec6e04d37e8e5775b621aa9 | |
| parent | f5fc423121d75a78dfccc6c0bc1d82e6839aceda (diff) | |
| download | AnySoftKeyboard-ea50d0a96fd6d0945bbdc911c7ccdb9cee68e58f.tar.gz AnySoftKeyboard-ea50d0a96fd6d0945bbdc911c7ccdb9cee68e58f.tar.bz2 | |
Converting to GitHub Actions
| -rw-r--r-- | .github/workflows/android.yml | 122 | ||||
| -rwxr-xr-x | scripts/ci/ci_deploy.sh | 8 | ||||
| -rwxr-xr-x | scripts/ci/ci_test.sh | 2 |
3 files changed, 123 insertions, 9 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 000000000..183beccf7 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,122 @@ +name: AnySoftKeyboard + +on: + push: + branches: + - master + - release-branch-v* + pull_request: + branches: + - '*' + paths-ignore: + - '**.md' + +jobs: + checks: + runs-on: ubuntu-18.04 + container: menny/ndk_ask:1.12.1 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: setup + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + run: | + echo "ENV:" + printenv + echo "******" + echo "Event: " + cat ${GITHUB_EVENT_PATH} + echo "***" + ./scripts/ci/ci_setup.sh + + - name: check + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + run: ./scripts/ci/ci_check.sh + - uses: actions/upload-artifact@v1.0.0 + with: + name: debug-apk + path: app/build/outputs/apk/debug/app-debug.apk + + heavy-tests: + runs-on: ubuntu-18.04 + container: menny/ndk_ask:1.12.1 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: setup + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + run: ./scripts/ci/ci_setup.sh + - name: tests + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + CODECOV_TOKEN: 1a4cd171-2784-4f48-8a62-0b7ec31e6d7e + run: | + ./scripts/ci/ci_test_heavy.sh + curl https://codecov.io/bash -o codecov.sh + chmod +x codecov.sh + ./codecov.sh -X gcov -X coveragepy -X xcode `find . -name "test*UnitTestCoverage.xml" | xargs -n 1 echo -n " -f "` + + + normal-tests: + runs-on: ubuntu-18.04 + container: menny/ndk_ask:1.12.1 + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: setup + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + run: ./scripts/ci/ci_setup.sh + - name: tests + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + CODECOV_TOKEN: 1a4cd171-2784-4f48-8a62-0b7ec31e6d7e + run: | + ./gradlew --stacktrace testDebugUnitTest testDebugUnitTestCoverage -PexcludeTestClasses="**/*AllSdkTest*" + curl https://codecov.io/bash -o codecov.sh + chmod +x codecov.sh + ./codecov.sh -X gcov -X coveragepy -X xcode `find . -name "test*UnitTestCoverage.xml" | xargs -n 1 echo -n " -f "` + + deploy: + if: github.event_name == 'push' + needs: [checks, normal-tests, heavy-tests] + runs-on: ubuntu-18.04 + container: menny/ndk_ask:1.12.1 + steps: + - uses: actions/checkout@v1 + - name: setup + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + run: ./scripts/ci/ci_setup.sh + - name: deploy + env: + TERM: dumb + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + RELEASE_BUILD: ${{ contains(github.ref, 'release-branch-v') }} + BUILD_TYPE: "release" + KEYSTORE_FILE_URL: ${{ secrets.KEYSTORE_FILE_URL }} + PUBLISH_CERT_FILE_URL: ${{ secrets.PUBLISH_CERT_FILE_URL }} + ANYSOFTKEYBOARD_CRASH_REPORT_EMAIL: ${{ secrets.ANYSOFTKEYBOARD_CRASH_REPORT_EMAIL }} + ANYSOFTKEYBOARD_KEYSTORE_ALIAS: ${{ secrets.ANYSOFTKEYBOARD_KEYSTORE_ALIAS }} + ANYSOFTKEYBOARD_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANYSOFTKEYBOARD_KEYSTORE_KEY_PASSWORD }} + ANYSOFTKEYBOARD_KEYSTORE_PASSWORD: ${{ secrets.ANYSOFTKEYBOARD_KEYSTORE_PASSWORD }} + PUBLISH_APK_SERVICE_ACCOUNT_EMAIL: ${{ secrets.PUBLISH_APK_SERVICE_ACCOUNT_EMAIL }} + run: | + echo "This will deploy" + export BUILD_COUNT_FOR_VERSION=$(git rev-list --count ${GITHUB_REF}) + export BUILD_TYPE="canary" + if [[ "${RELEASE_BUILD}" == "true" ]] then BUILD_TYPE="release" fi + echo "Counter is ${BUILD_COUNT_FOR_VERSION}, build-type: ${BUILD_TYPE}, RELEASE_BUILD: ${RELEASE_BUILD}, and crash email: ${ANYSOFTKEYBOARD_CRASH_REPORT_EMAIL}" diff --git a/scripts/ci/ci_deploy.sh b/scripts/ci/ci_deploy.sh index 5c0c49ee0..114f3e16d 100755 --- a/scripts/ci/ci_deploy.sh +++ b/scripts/ci/ci_deploy.sh @@ -3,7 +3,6 @@ set -e ## Assuming the following environment variables # BUILD_TYPE -# REPO_USER # KEYSTORE_FILE_URL # PUBLISH_CERT_FILE_URL @@ -22,13 +21,6 @@ else exit 1 fi -if [[ "${REPO_USER}" == "AnySoftKeyboard" ]]; then - echo "Repo owner is allowed for deploy." -else - echo "Invalid repo owner '${REPO_USER}'. Can not deploy." - exit 1 -fi - # from this point, we fail with error when stuff missing, since we want to deploy. if [[ -z "${KEYSTORE_FILE_URL}" ]]; then diff --git a/scripts/ci/ci_test.sh b/scripts/ci/ci_test.sh index e4b3ecfff..a06caa4d8 100755 --- a/scripts/ci/ci_test.sh +++ b/scripts/ci/ci_test.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -./gradlew --stacktrace -DmaxTestForks=1 --max-workers=3 testDebugUnitTest testDebugUnitTestCoverage -PexcludeTestClasses="**/*AllSdkTest*" +./gradlew --stacktrace testDebugUnitTest testDebugUnitTestCoverage -PexcludeTestClasses="**/*AllSdkTest*" |
