-
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.
Resolves: DCMAW-8361 Co-authored-by: Aamir <[email protected]>
- Loading branch information
1 parent
6c10b16
commit 33deb5b
Showing
5 changed files
with
245 additions
and
17 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
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,21 @@ | ||
name: 'Bundle reports' | ||
description: 'Zip and upload build reports' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Bundle build reports | ||
id: bundleReports | ||
run: | | ||
zip -9 -r reports.zip **/build/reports | ||
shell: bash | ||
|
||
- name: Upload build reports | ||
id: uploadBuildReports | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-reports | ||
retention-days: 1 | ||
if-no-files-found: error | ||
path: | | ||
reports.zip |
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 @@ | ||
name: 'Run gradle check' | ||
description: 'Run the "check" command for a Gradle project' | ||
|
||
inputs: | ||
version-code: | ||
description: 'Version code' | ||
required: true | ||
version-name: | ||
description: 'Version name' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Run Gradle Check | ||
shell: bash | ||
run: | | ||
./gradlew \ | ||
detekt \ | ||
ktlintCheck \ | ||
lintDebug \ | ||
shellcheck \ | ||
check \ | ||
verifyPaparazziDebug \ | ||
-PversionCode=$INPUT_VERSION_CODE \ | ||
-PversionName=$INPUT_VERSION_NAME \ | ||
--stacktrace | ||
env: | ||
CI: 'true' | ||
INPUT_VERSION_CODE: ${{ inputs.version-code }} | ||
INPUT_VERSION_NAME: ${{ inputs.version-name }} |
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,100 @@ | ||
name: 'Run gradle check' | ||
description: 'Run the "check" command for a Gradle project' | ||
|
||
inputs: | ||
architecture: | ||
description: 'AVD architecture to use' | ||
required: false | ||
default: 'x86_64' | ||
device-profile: | ||
description: 'AVD device profile to use' | ||
required: false | ||
default: 'pixel_5' | ||
locale: | ||
description: 'Locale used within the emulator' | ||
required: false | ||
default: 'en-GB' | ||
version-code: | ||
description: 'Version code' | ||
required: true | ||
version-name: | ||
description: 'Version name' | ||
required: true | ||
shard-count: | ||
default: 3 | ||
description: 'The number of Gradle managed devices to run at once for larger test suites' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Stop all emulators | ||
run: | | ||
.sh/stopAllEmulators.sh | ||
shell: bash | ||
|
||
- name: Set up Gradle managed devices | ||
env: | ||
INPUT_VERSION_CODE: ${{ inputs.version-code }} | ||
INPUT_VERSION_NAME: ${{ inputs.version-name }} | ||
run: | | ||
./gradlew \ | ||
googleAtdPixelXLApi30Setup \ | ||
--continue \ | ||
--max-workers=1 \ | ||
--stacktrace \ | ||
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect \ | ||
-PversionCode=${INPUT_VERSION_CODE} \ | ||
-PversionName=${INPUT_VERSION_NAME} \ | ||
shell: bash | ||
|
||
- name: Run larger Gradle managed device test suites | ||
env: | ||
INPUT_SHARD_COUNT: ${{ inputs.shard-count }} | ||
INPUT_VERSION_CODE: ${{ inputs.version-code }} | ||
INPUT_VERSION_NAME: ${{ inputs.version-name }} | ||
run: | | ||
./gradlew \ | ||
:app:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:network:api:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:repositories:impl:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:ui:components:googleAtdPixelXLApi30DebugAndroidTest \ | ||
:modules:ui:presentation:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
--continue \ | ||
--max-workers=1 \ | ||
--stacktrace \ | ||
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect \ | ||
-PversionCode=${INPUT_VERSION_CODE} \ | ||
-PversionName=${INPUT_VERSION_NAME} \ | ||
shell: bash | ||
|
||
- name: Run smaller Gradle managed device test suites | ||
env: | ||
INPUT_VERSION_CODE: ${{ inputs.version-code }} | ||
INPUT_VERSION_NAME: ${{ inputs.version-name }} | ||
run: | | ||
./gradlew \ | ||
:modules:features:api:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:iproov:api:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:iproov:impl:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:iproov:testdouble:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:logging:api:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:logging:impl:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:logging:testdouble:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:network:impl:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:network:testdouble:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:readid:common:api:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:readid:common:impl:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:readid:common:testdouble:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:readid:translations:googleAtdPixelXLApi30DebugAndroidTest \ | ||
:modules:repositories:api:googleAtdPixelXLApi30DebugAndroidTest \ | ||
:modules:testingFramework:instrumentation:googleAtdPixelXLApi30BuildDebugAndroidTest \ | ||
:modules:ui:pages:googleAtdPixelXLApi30DebugAndroidTest \ | ||
:modules:ui:theme:googleAtdPixelXLApi30DebugAndroidTest \ | ||
--continue \ | ||
--max-workers=1 \ | ||
--stacktrace \ | ||
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect \ | ||
-PversionCode=${INPUT_VERSION_CODE} \ | ||
-PversionName=${INPUT_VERSION_NAME} \ | ||
shell: bash |
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,93 @@ | ||
name: 'Setup Runner' | ||
description: 'Set up GitHub Runner environment for building the Android OneLogin app' | ||
inputs: | ||
jdk-version: | ||
description: 'The Java Development Kit (JDK) version to use' | ||
required: false | ||
default: '17' | ||
gradle-version: | ||
description: 'The version of gradle for the "gradle/gradle-build-action" step.' | ||
required: false | ||
default: 'wrapper' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Add path globally | ||
shell: bash | ||
run: echo "/usr/local/bin" >> $GITHUB_PATH | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'oracle' | ||
java-version: ${{ inputs.jdk-version }} | ||
|
||
- name: Add JAVA_HOME globally | ||
env: | ||
JDK_VERSION: ${{ inputs.jdk-version }} | ||
run: | | ||
echo "JAVA_HOME=$(/usr/libexec/java_home --version ${JDK_VERSION})" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Install snap dependencies | ||
run: | | ||
sudo snap install vale --edge | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
|
||
- name: Install brew dependencies | ||
run: | | ||
brew install vale rbenv ruby-build | ||
shell: bash | ||
if: runner.os == 'macOS' | ||
|
||
- name: Install KVM hardware acceleration Dependencies | ||
run: | | ||
sudo apt-get install \ | ||
bridge-utils \ | ||
cpu-checker \ | ||
libvirt-clients \ | ||
libvirt-daemon-system \ | ||
qemu-kvm \ | ||
rbenv \ | ||
ruby-build | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
|
||
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ | ||
- name: Configure KVM hardware acceleration | ||
run: | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
|
||
- name: Modify KVM groups / rules | ||
run: | | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
sudo adduser $(id -un) libvirt | ||
sudo adduser $(id -un) kvm | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
|
||
- name: Confirm KVM hardware acceleration is installed | ||
run: | | ||
kvm-ok | ||
egrep --count '(vmx|svm)' /proc/cpuinfo | ||
shell: bash | ||
if: runner.os == 'Linux' | ||
|
||
- name: Setup Gradle | ||
id: setupGradle | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
CI: 'true' | ||
with: | ||
gradle-version: ${{ inputs.gradle-version }} | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- name: Update Android SDK Manager | ||
run: | | ||
sdkmanager --update | ||
shell: bash |