-
Notifications
You must be signed in to change notification settings - Fork 6
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
ci(GH): fix the issue with invalid script prevent android test action from running #1927
Merged
MohamadJaara
merged 2 commits into
develop
from
ci/run-andtoid-test-gh-action-not-working
Jul 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
|
@@ -13,37 +13,37 @@ jobs: | |
detekt: | ||
uses: ./.github/workflows/codestyle.yml | ||
gradle-run-tests: | ||
needs: [detekt] | ||
needs: [ detekt ] | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
strategy: | ||
matrix: | ||
api-level: [30] | ||
api-level: [ 30 ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Gradle Setup | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b | ||
|
||
- name: Build the samples | ||
env: | ||
GITHUB_USER: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
./gradlew :samples:compileDebugSources | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Gradle Setup | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b | ||
|
||
- name: Build the samples | ||
env: | ||
GITHUB_USER: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
./gradlew :samples:compileDebugSources | ||
|
||
# - name: AVD cache | ||
# uses: actions/cache@v3 | ||
|
@@ -68,69 +68,70 @@ jobs: | |
# disable-animations: false | ||
# script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: Android Instrumentation Tests | ||
uses: reactivecircus/[email protected] | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: google_apis | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
cores: 4 | ||
ram-size: 4096M | ||
heap-size: 2048M | ||
script: ./gradlew connectedAndroidOnlyAffectedTest | ||
env: | ||
GITHUB_USER: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Archive Test Reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-reports | ||
path: ./**/build/reports/tests/** | ||
|
||
- name: Archive Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: | | ||
./**/build/test-results/**/*.xml | ||
./**/build/outputs/androidTest-results/**/*.xml | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action/[email protected] | ||
if: always() | ||
with: | ||
files: | | ||
**/build/test-results/**/*.xml | ||
**/build/outputs/androidTest-results/**/*.xml | ||
|
||
- name: Cleanup Gradle Cache | ||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | ||
- name: Android Instrumentation Tests | ||
uses: reactivecircus/[email protected] | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: google_apis | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
cores: 4 | ||
ram-size: 4096M | ||
heap-size: 2048M | ||
script: ./gradlew connectedAndroidOnlyAffectedTest | ||
env: | ||
GITHUB_USER: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Archive Test Reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-reports | ||
path: ./**/build/reports/tests/** | ||
|
||
- name: Archive Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: | | ||
./**/build/test-results/**/*.xml | ||
./**/build/outputs/androidTest-results/**/*.xml | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action/[email protected] | ||
if: always() | ||
with: | ||
files: | | ||
**/build/test-results/**/*.xml | ||
**/build/outputs/androidTest-results/**/*.xml | ||
|
||
- name: Cleanup Gradle Cache | ||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | ||
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties | ||
|
||
upload-test-results-datadadog: | ||
runs-on: ubuntu-latest | ||
needs: gradle-run-tests | ||
if: always() | ||
|
||
steps: | ||
- name: Download tests results | ||
uses: actions/download-artifact@v3 | ||
continue-on-error: true | ||
with: | ||
name: test-results | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install datadog-ci | ||
run: npm install -g @datadog/datadog-ci | ||
- name: "Upload results" | ||
env: | ||
- name: Download tests results | ||
uses: actions/download-artifact@v3 | ||
continue-on-error: true | ||
with: | ||
name: test-results | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install datadog-ci | ||
run: | | ||
npm install -g @datadog/datadog-ci | ||
name: "Upload results" | ||
env: | ||
DD_API_KEY: ${{ secrets.DD_API_KEY }} | ||
run: | | ||
DATADOG_API_KEY="${DD_API_KEY}" DD_ENV=ci DATADOG_SITE=datadoghq.eu datadog-ci junit upload --service kalium-android ./**/*.xml | ||
run: | | ||
DATADOG_API_KEY="${DD_API_KEY}" DD_ENV=ci DATADOG_SITE=datadoghq.eu datadog-ci junit upload --service kalium-android ./**/*.xml | ||
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.
the issue was here the code was invalid