aboutsummaryrefslogtreecommitdiff
path: root/.github/actions
diff options
context:
space:
mode:
authorMenny Even Danan <menny@evendanan.net>2019-10-30 17:19:21 +0000
committerGitHub <noreply@github.com>2019-10-30 17:19:21 +0000
commit1f1990d3330c5ea529eb7dc2343a9ad53eeefc36 (patch)
treed187325d6af2440c974198170d64de8e6b3344b6 /.github/actions
parente7b0fb9c67277fefe8d184d7bdb1e69928cdfc42 (diff)
parent467fa4b6daa14b41b4ef9db02e32bad1709e3599 (diff)
downloadAnySoftKeyboard-1f1990d3330c5ea529eb7dc2343a9ad53eeefc36.tar.gz
AnySoftKeyboard-1f1990d3330c5ea529eb7dc2343a9ad53eeefc36.tar.bz2
Breaking tests into reusable actions (#1868)
Breaking tests into reusable actions
Diffstat (limited to '.github/actions')
-rw-r--r--.github/actions/codecov/action.yml16
-rw-r--r--.github/actions/codecov/upload_coverage.sh5
-rw-r--r--.github/actions/collect-reports/action.yml22
-rw-r--r--.github/actions/collect-reports/collect.sh7
-rw-r--r--.github/actions/test-shard-run/action.yml29
-rw-r--r--.github/actions/test-shard-run/run_tests.sh10
6 files changed, 89 insertions, 0 deletions
diff --git a/.github/actions/codecov/action.yml b/.github/actions/codecov/action.yml
new file mode 100644
index 000000000..ae6de1d98
--- /dev/null
+++ b/.github/actions/codecov/action.yml
@@ -0,0 +1,16 @@
+name: "Code Cov"
+author: "menny"
+
+runs:
+ using: "docker"
+ image: "docker://menny/ndk_ask:1.13.1"
+ env:
+ TERM: dumb
+ CODECOV_TOKEN: 1a4cd171-2784-4f48-8a62-0b7ec31e6d7e
+ entrypoint: /bin/bash
+ args:
+ - .github/actions/codecov/upload_coverage.sh
+
+branding:
+ icon: 'pie-chart'
+ color: 'green'
diff --git a/.github/actions/codecov/upload_coverage.sh b/.github/actions/codecov/upload_coverage.sh
new file mode 100644
index 000000000..6d399d23f
--- /dev/null
+++ b/.github/actions/codecov/upload_coverage.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+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 "`
diff --git a/.github/actions/collect-reports/action.yml b/.github/actions/collect-reports/action.yml
new file mode 100644
index 000000000..b09e27ec8
--- /dev/null
+++ b/.github/actions/collect-reports/action.yml
@@ -0,0 +1,22 @@
+name: "Collect reports"
+author: "menny"
+
+inputs:
+ output_folder:
+ description: "collect destination"
+ default: "collected_reports"
+ file_pattern:
+ description: "pattern"
+
+runs:
+ using: "docker"
+ image: "docker://menny/ndk_ask:1.13.1"
+ entrypoint: /bin/bash
+ args:
+ - .github/actions/collect-reports/collect.sh
+ - ${{ inputs.output_folder }}
+ - ${{ inputs.file_pattern }}
+
+branding:
+ icon: 'package'
+ color: 'brown'
diff --git a/.github/actions/collect-reports/collect.sh b/.github/actions/collect-reports/collect.sh
new file mode 100644
index 000000000..da274db47
--- /dev/null
+++ b/.github/actions/collect-reports/collect.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+OUTPUT=${1}
+PATTERN=${2}
+rm -rf ${OUTPUT} || true
+mkdir ${OUTPUT} || true
+find . -path ./${OUTPUT} -prune -o -name "${PATTERN}" -exec cp {} ${OUTPUT}/ \;
diff --git a/.github/actions/test-shard-run/action.yml b/.github/actions/test-shard-run/action.yml
new file mode 100644
index 000000000..4d4582dce
--- /dev/null
+++ b/.github/actions/test-shard-run/action.yml
@@ -0,0 +1,29 @@
+name: "Run tests"
+author: "menny"
+
+inputs:
+ index:
+ description: "zero-based index of the shard"
+ groups_count:
+ description: "count of groups"
+ default: 3
+ module:
+ default: ""
+ extra_args:
+ default: ""
+runs:
+ using: "docker"
+ image: "docker://menny/ndk_ask:1.13.1"
+ env:
+ TERM: dumb
+ entrypoint: /bin/bash
+ args:
+ - .github/actions/test-shard-run/run_tests.sh
+ - ${{ inputs.groups_count }}
+ - ${{ inputs.index }}
+ - ${{ inputs.module }}
+ - ${{ inputs.extra_args }}
+
+branding:
+ icon: 'activity'
+ color: 'yellow'
diff --git a/.github/actions/test-shard-run/run_tests.sh b/.github/actions/test-shard-run/run_tests.sh
new file mode 100644
index 000000000..08871151c
--- /dev/null
+++ b/.github/actions/test-shard-run/run_tests.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+export TEST_GROUPS_COUNT=${1}
+export TEST_GROUP_INDEX=${2}
+MODULE=${3}
+EXTRA_ARGS=${4}
+
+echo "Will run tests for module '${MODULE}' with extra args '${EXTRA_ARGS}' for group-index ${TEST_GROUP_INDEX} out of ${TEST_GROUPS_COUNT} groups:"
+
+./gradlew --stacktrace -Dorg.gradle.daemon=false ${MODULE}testDebugUnitTest ${MODULE}testDebugUnitTestCoverage ${EXTRA_ARGS}