-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIMOB-2183: Add UI test GHA flow #247
Merged
jheng-hao-lin-cko
merged 15 commits into
feature/PIMOB-2191_Upgrade_kotlin_compose_and_agp
from
PIMOB-2183-add_UI_tests
Oct 17, 2023
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
79915aa
Add UI test GHA flow
jheng-hao-lin-cko f8f682b
Experiment using macOs-latest to run
jheng-hao-lin-cko 41de539
Experiment using macOs-latest to run
jheng-hao-lin-cko 66a540e
Experiment using macOs-latest to run
jheng-hao-lin-cko ffbbef5
Experiment using macOs-latest to run
jheng-hao-lin-cko 2cb347f
Experiment using macOs-latest to run
jheng-hao-lin-cko c6e4830
change rebase
jheng-hao-lin-cko 796f55e
update workflow
jheng-hao-lin-cko ba6c2b3
update workflow
jheng-hao-lin-cko 17de1b0
Abstract workflows
jheng-hao-lin-cko 9b82c0e
update workflows
jheng-hao-lin-cko 37eceb6
update workflows
jheng-hao-lin-cko c66bb57
update workflows
jheng-hao-lin-cko 73ee22f
update workflows
jheng-hao-lin-cko 418841b
restore version change
jheng-hao-lin-cko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,14 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
jobs: | ||
android-lint: | ||
uses: ./.github/workflows/gradle-task.yml | ||
with: | ||
module: ${{ inputs.module }} | ||
task: lint | ||
task-name: Run Android Lint 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,18 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
variant: | ||
description: 'Variant to build' | ||
required: true | ||
type: string | ||
jobs: | ||
assemble: | ||
uses: ./.github/workflows/gradle-task.yml | ||
with: | ||
module: ${{ inputs.module }} | ||
task: assemble${{inputs.variant}} | ||
task-name: Assemble ${{inputs.module}} - ${{inputs.variant}} |
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,40 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
task: | ||
description: 'Task to run' | ||
required: true | ||
type: string | ||
task-name: | ||
description: 'Task Name' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
task: | ||
name: ${{ inputs.task-name }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Cache Gradle and wrapper | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
- name: Run unit tests with Gradle | ||
run: ./gradlew :${{ inputs.module }}:${{ inputs.task }} | ||
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,14 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
jobs: | ||
ktlint: | ||
uses: ./.github/workflows/gradle-task.yml | ||
with: | ||
module: ${{ inputs.module }} | ||
task: ktlint | ||
task-name: Run Ktlint 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,47 @@ | ||
name: UI Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
connected-android-tests: | ||
name: Run Connected Android Tests | ||
# Run on macOS because we need to run the emulator and the emulator is not supported on Linux | ||
runs-on: macos-latest | ||
strategy: | ||
fail-fast: true | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Cache Gradle and wrapper | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
|
||
- name: Launch Emulator | ||
run: chmod +x ./scripts/launch-emulator.sh && ./scripts/launch-emulator.sh | ||
|
||
- name: Run UI Test on ${{ inputs.module }} | ||
run: ./gradlew :${{ inputs.module }}:connectedAndroidTest --stacktrace |
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,14 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
jobs: | ||
unit-test: | ||
uses: ./.github/workflows/gradle-task.yml | ||
with: | ||
module: ${{ inputs.module }} | ||
task: test | ||
task-name: Run Unit Tests |
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,73 @@ | ||
name: Verification | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
module: | ||
description: 'Module to run' | ||
required: true | ||
type: string | ||
run-android-lint: | ||
description: 'Should Run Android Lint' | ||
required: false | ||
type: boolean | ||
default: false | ||
run-ktlint: | ||
description: 'Should Run Ktlint' | ||
required: false | ||
type: boolean | ||
default: false | ||
run-assemble: | ||
description: 'Should Run Assemble' | ||
required: false | ||
type: boolean | ||
default: false | ||
assemble-variant: | ||
description: 'Variant to Run Assemble' | ||
required: false | ||
type: string | ||
default: '' | ||
run-unit-test: | ||
description: 'Should Run Unit Tests' | ||
required: false | ||
type: boolean | ||
default: false | ||
run-ui-test: | ||
description: 'Should Run UI Tests' | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
android-lint: | ||
if: ${{ inputs.run-android-lint }} | ||
uses: ./.github/workflows/android-lint.yml | ||
with: | ||
module: ${{ inputs.module }} | ||
ktlint: | ||
if: ${{ inputs.run-ktlint }} | ||
uses: ./.github/workflows/ktlint.yml | ||
with: | ||
module: ${{ inputs.module }} | ||
assemble: | ||
if: ${{ inputs.run-assemble }} | ||
uses: ./.github/workflows/assemble-module.yml | ||
# Add ktlint after ktlint is applied to all modules | ||
needs: android-lint | ||
with: | ||
module: ${{ inputs.module }} | ||
variant: ${{ inputs.assemble-variant }} | ||
unit-test: | ||
if: ${{ inputs.run-unit-test }} | ||
uses: ./.github/workflows/unit-test.yml | ||
# Add ktlint after ktlint is applied to all modules | ||
needs: android-lint | ||
with: | ||
module: ${{ inputs.module }} | ||
ui-test: | ||
if: ${{ inputs.run-ui-test }} | ||
uses: ./.github/workflows/ui-test.yml | ||
# Add ktlint after ktlint is applied to all modules | ||
needs: android-lint | ||
with: | ||
module: ${{ inputs.module }} |
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,28 @@ | ||
name: Verify App | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
types: [ opened, synchronize, reopened ] | ||
branches: [ master, "bugfix/*", "feature/*", "release/*" ] | ||
paths: | ||
- 'app/**' | ||
- 'checkout/**' | ||
- 'frames/**' | ||
- 'buildSrc/**' | ||
- 'build.gradle.kt' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify-module: | ||
uses: ./.github/workflows/verification-flow.yml | ||
with: | ||
module: app | ||
run-android-lint: true | ||
run-assemble: true | ||
run-unit-test: true |
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,27 @@ | ||
name: Verify Checkout | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
types: [ opened, synchronize, reopened ] | ||
branches: [ master, "bugfix/*", "feature/*", "release/*" ] | ||
paths: | ||
- 'checkout/**' | ||
- 'buildSrc/**' | ||
- 'build.gradle.kt' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify-module: | ||
uses: ./.github/workflows/verification-flow.yml | ||
with: | ||
module: checkout | ||
run-android-lint: true | ||
run-ktlint: true | ||
run-assemble: true | ||
run-unit-test: true |
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,29 @@ | ||
name: Verify Example App Frames | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
types: [ opened, synchronize, reopened ] | ||
branches: [ master, "bugfix/*", "feature/*", "release/*" ] | ||
paths: | ||
- 'checkout/**' | ||
- 'frames/**' | ||
- 'example_app_frames/**' | ||
- 'buildSrc/**' | ||
- 'build.gradle.kt' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify-module: | ||
uses: ./.github/workflows/verification-flow.yml | ||
with: | ||
module: example_app_frames | ||
run-android-lint: true | ||
run-ktlint: true | ||
run-assemble: true | ||
run-unit-test: true |
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,29 @@ | ||
name: Verify Frames | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
types: [ opened, synchronize, reopened ] | ||
branches: [ master, "bugfix/*", "feature/*", "release/*" ] | ||
paths: | ||
- 'checkout/**' | ||
- 'frames/**' | ||
- 'buildSrc/**' | ||
- 'build.gradle.kt' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify-module: | ||
uses: ./.github/workflows/verification-flow.yml | ||
with: | ||
module: frames | ||
run-android-lint: true | ||
run-ktlint: true | ||
run-assemble: true | ||
run-unit-test: true | ||
run-ui-test: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏