-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Implement E2E tests parallelization and nightly runs (#5480)
* [CI] Implement E2E tests parallelization and nightly runs * Resolve comments
- Loading branch information
1 parent
b568c6b
commit e838cc2
Showing
27 changed files
with
323 additions
and
288 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,18 @@ | ||
name: 'Allure Launch' | ||
description: 'Launches Allure TestOps job' | ||
inputs: | ||
allure-token: | ||
description: 'ALLURE_TOKEN' | ||
required: true | ||
cron: | ||
description: 'Is this a cron check?' | ||
default: 'false' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Launch Allure TestOps | ||
run: bundle exec fastlane allure_launch cron:${{ inputs.cron }} | ||
shell: bash | ||
env: | ||
ALLURE_TOKEN: ${{ inputs.allure-token }} | ||
GITHUB_EVENT: ${{ toJson(github.event) }} |
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,10 @@ | ||
name: 'Setup Java' | ||
description: 'Setup Java' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: adopt | ||
java-version: 17 |
4 changes: 2 additions & 2 deletions
4
.github/actions/ruby-cache/action.yml → .github/actions/setup-ruby/action.yml
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 |
---|---|---|
|
@@ -12,11 +12,7 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Prepare environment | ||
run: | | ||
git fetch --unshallow | ||
|
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 |
---|---|---|
|
@@ -12,11 +12,7 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Prepare environment | ||
run: | | ||
git fetch --unshallow | ||
|
@@ -44,11 +40,7 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Prepare environment | ||
run: | | ||
git fetch --unshallow | ||
|
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 |
---|---|---|
|
@@ -17,11 +17,7 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Build | ||
run: ./gradlew assembleDebug :stream-chat-android-ui-uitests:assembleDebugAndroidTest | ||
|
||
|
@@ -31,11 +27,7 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Build | ||
run: ./gradlew assembleRelease | ||
|
||
|
@@ -45,11 +37,7 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Unit tests | ||
run: ./scripts/ci-unit-tests.sh | ||
- name: Upload testDebugUnitTest results | ||
|
@@ -65,11 +53,7 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: build demo debug | ||
run: ./gradlew stream-chat-android-ui-components-sample:assembleDemoDebug | ||
- name: Upload artifact to Emerge | ||
|
@@ -85,11 +69,7 @@ jobs: | |
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: build debug | ||
run: ./gradlew stream-chat-android-compose-sample:assembleDebug | ||
- name: Upload artifact to Emerge | ||
|
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 |
---|---|---|
|
@@ -11,11 +11,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- name: Find touched DB Entities | ||
id: touchedEntities | ||
continue-on-error: 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 |
---|---|---|
|
@@ -15,11 +15,7 @@ jobs: | |
with: | ||
ref: develop | ||
token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
- uses: ./.github/actions/setup-java | ||
- uses: tibdex/[email protected] | ||
id: generate-token | ||
with: | ||
|
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 @@ | ||
name: E2E Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
app: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: ${{ inputs.app }} apks | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/setup-java | ||
- uses: ./.github/actions/enable-kvm | ||
- uses: ./.github/actions/setup-ruby | ||
- uses: ./.github/actions/gradle-cache | ||
with: | ||
key-prefix: gradle-test | ||
- name: Build apks | ||
run: bundle exec fastlane build_e2e_test | ||
- name: Upload apks | ||
uses: actions/[email protected] | ||
with: | ||
name: apks | ||
path: | | ||
stream-chat-android-${{ inputs.app }}-sample/build/outputs/apk/e2e/debug/*.apk | ||
stream-chat-android-${{ inputs.app }}-sample/build/outputs/apk/androidTest/e2e/debug/*.apk |
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,86 @@ | ||
name: E2E Tests Nightly | ||
|
||
on: | ||
schedule: | ||
# Runs "At 01:00 every night except weekends" | ||
- cron: '0 1 * * 1-5' | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
build-compose-apks: | ||
name: Build | ||
uses: ./.github/workflows/e2e-build.yml | ||
with: | ||
app: compose | ||
|
||
run-compose-tests-nightly: | ||
name: Test compose | ||
runs-on: ubuntu-24.04 | ||
needs: build-compose-apks | ||
strategy: | ||
matrix: | ||
include: | ||
- android_api_level: 35 | ||
- android_api_level: 34 | ||
- android_api_level: 33 | ||
- android_api_level: 32 | ||
- android_api_level: 31 | ||
- android_api_level: 29 | ||
- android_api_level: 28 | ||
fail-fast: false | ||
env: | ||
ANDROID_API_LEVEL: ${{ matrix.android_api_level }} | ||
steps: | ||
- name: Connect Bot | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
continue-on-error: true | ||
with: | ||
name: apks | ||
- uses: ./.github/actions/setup-java | ||
- uses: ./.github/actions/enable-kvm | ||
- uses: ./.github/actions/setup-ruby | ||
- uses: ./.github/actions/allure-launch | ||
with: | ||
allure-token: ${{ secrets.ALLURE_TOKEN }} | ||
cron: true | ||
- name: Run tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ env.ANDROID_API_LEVEL }} | ||
disable-animations: true | ||
profile: pixel | ||
arch : x86_64 | ||
emulator-options: ${{ vars.EMULATOR_OPTIONS }} | ||
script: bundle exec fastlane run_e2e_test | ||
- name: Allure TestOps Upload | ||
run: bundle exec fastlane allure_upload | ||
if: success() || failure() | ||
env: | ||
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
LAUNCH_ID: ${{ env.LAUNCH_ID }} | ||
- name: Allure TestOps Launch Removal | ||
run: bundle exec fastlane allure_launch_removal | ||
if: cancelled() | ||
env: | ||
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
LAUNCH_ID: ${{ env.LAUNCH_ID }} | ||
- name: Upload test results | ||
uses: actions/[email protected] | ||
if: failure() | ||
with: | ||
name: test_report | ||
path: | | ||
./**/build/reports/androidTests/* | ||
fastlane/stream-chat-test-mock-server/logs/* |
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,78 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_PR_NUM: ${{ github.event.pull_request.number }} | ||
|
||
jobs: | ||
build-compose-apks: | ||
name: Build | ||
uses: ./.github/workflows/e2e-build.yml | ||
with: | ||
app: compose | ||
|
||
run-compose-tests: | ||
name: Test compose | ||
runs-on: ubuntu-24.04 | ||
needs: build-compose-apks | ||
strategy: | ||
matrix: | ||
include: | ||
- batch: 0 | ||
- batch: 1 | ||
env: | ||
ANDROID_API_LEVEL: 35 | ||
steps: | ||
- name: Connect Bot | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
continue-on-error: true | ||
with: | ||
name: apks | ||
- uses: ./.github/actions/setup-java | ||
- uses: ./.github/actions/enable-kvm | ||
- uses: ./.github/actions/setup-ruby | ||
- uses: ./.github/actions/allure-launch | ||
with: | ||
allure-token: ${{ secrets.ALLURE_TOKEN }} | ||
- name: Run tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ env.ANDROID_API_LEVEL }} | ||
disable-animations: true | ||
profile: pixel | ||
arch : x86_64 | ||
emulator-options: ${{ vars.EMULATOR_OPTIONS }} | ||
script: bundle exec fastlane run_e2e_test batch:${{ matrix.batch }} batch_count:${{ strategy.job-total }} | ||
- name: Allure TestOps Upload | ||
if: success() || failure() | ||
run: bundle exec fastlane allure_upload | ||
env: | ||
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
LAUNCH_ID: ${{ env.LAUNCH_ID }} | ||
- name: Allure TestOps Launch Removal | ||
if: cancelled() | ||
run: bundle exec fastlane allure_launch_removal | ||
env: | ||
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
LAUNCH_ID: ${{ env.LAUNCH_ID }} | ||
- name: Upload test results | ||
uses: actions/[email protected] | ||
if: failure() | ||
with: | ||
name: test_report | ||
path: | | ||
./**/build/reports/androidTests/* | ||
fastlane/stream-chat-test-mock-server/logs/* |
Oops, something went wrong.