Skip to content

Commit

Permalink
chore(pipeline): update workflows
Browse files Browse the repository at this point in the history
SUITEDEV-35237

Co-authored-by: davidSchuppa <[email protected]>
Co-authored-by: megamegax <[email protected]>
Co-authored-by: Andras Sarro <[email protected]>
Co-authored-by: matusekma <[email protected]>
  • Loading branch information
5 people committed Feb 29, 2024
1 parent 5e42455 commit 0390e8f
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 465 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/auto_merge_dependabot_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Auto-Merge Dependabot PRs on CI Success

on:
repository_dispatch:
types: [ checks-complete ]
jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- run: echo "PR_NUMBER=${{ toJson(github.event.client_payload.prNumber) }}" >> $GITHUB_ENV
- name: Wait for 10 seconds
run: sleep 10
- name: Check CI status and Merge PR
uses: actions/github-script@v7
with:
script: |
const prNumber = process.env.PR_NUMBER;
if (!prNumber) {
console.log("No PR number found.");
return;
}
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
if(pullRequest.merged) {
console.log(`PR #${prNumber} is already merged.`);
return;
}
const { data: listCheckRuns } = await github.rest.checks.listForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: pullRequest.head.sha,
});
console.log("checks: ", listCheckRuns);
const allChecksPassed = listCheckRuns.check_runs.every(check => check.conclusion === 'success' || check.name === 'Inclusive Language' || check.conclusion === 'skipped');
if (allChecksPassed) {
await github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
console.log(`Merged PR #${prNumber}`);
} else {
console.log(`Not all checks passed for PR #${prNumber}`);
}
github-token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 5 additions & 6 deletions .github/workflows/nightly_e2e_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
RELEASE_STORE_FILE: ${{ secrets.RELEASE_STORE_FILE }}
DEVELOPMENT_MODE: ${{ secrets.DEVELOPMENT_MODE }}
GOOGLE_SERVICES_API_KEY: ${{ secrets.GOOGLE_SERVICES_API_KEY }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://icons.iconarchive.com/icons/martz90/circle/256/android-icon.png
SLACK_TITLE: Commit status
Expand All @@ -31,7 +30,7 @@ jobs:

- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
Expand All @@ -50,13 +49,13 @@ jobs:
run: ./gradlew assembleAndroidTest -x lint

- name: upload sample app artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: sample
path: sample/build/outputs/apk/androidTest/debug/sample-debug-androidTest.apk

- name: upload emarsys-e2e-test test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: emarsys-e2e-test
path: emarsys-e2e-test/build/outputs/apk/androidTest/debug/emarsys-e2e-test-debug-androidTest.apk
Expand All @@ -79,12 +78,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download Emarsys E2E tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: emarsys-e2e-test

Expand Down
63 changes: 31 additions & 32 deletions .github/workflows/nightly_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
RELEASE_STORE_FILE: ${{ secrets.RELEASE_STORE_FILE }}
DEVELOPMENT_MODE: ${{ secrets.DEVELOPMENT_MODE }}
GOOGLE_SERVICES_API_KEY: ${{ secrets.GOOGLE_SERVICES_API_KEY }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://icons.iconarchive.com/icons/martz90/circle/256/android-icon.png
SLACK_TITLE: Nightly build status
Expand All @@ -30,7 +29,7 @@ jobs:
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
Expand All @@ -48,55 +47,55 @@ jobs:
run: ./gradlew assembleAndroidTest -x lint

- name: upload sample app artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: sample
path: sample/build/outputs/apk/androidTest/debug/sample-debug-androidTest.apk

- name: upload core test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: core
path: core/build/outputs/apk/androidTest/debug/core-debug-androidTest.apk

- name: upload mobile-engage test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: mobile-engage
path: mobile-engage/build/outputs/apk/androidTest/debug/mobile-engage-debug-androidTest.apk

- name: upload predict test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: predict
path: predict/build/outputs/apk/androidTest/debug/predict-debug-androidTest.apk

- name: upload emarsys test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: emarsys
path: emarsys/build/outputs/apk/androidTest/debug/emarsys-debug-androidTest.apk

- name: upload emarsys-sdk test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: emarsys-sdk
path: emarsys-sdk/build/outputs/apk/androidTest/debug/emarsys-sdk-debug-androidTest.apk

- name: upload common test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: common
path: common/build/outputs/apk/androidTest/debug/common-debug-androidTest.apk

- name: upload emarsys-firebase test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: emarsys-firebase
path: emarsys-firebase/build/outputs/apk/androidTest/debug/emarsys-firebase-debug-androidTest.apk

- name: upload emarsys-huawei test apk artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: emarsys-huawei
path: emarsys-huawei/build/outputs/apk/androidTest/debug/emarsys-huawei-debug-androidTest.apk
Expand All @@ -118,7 +117,7 @@ jobs:
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
Expand All @@ -170,7 +169,7 @@ jobs:
run: ./gradlew :sample:bundleRelease

- name: Upload bundle
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: mobile-sdk-sample
path: sample/build/outputs/bundle/release/sample-release.aab
Expand All @@ -188,12 +187,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download core tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: core

Expand All @@ -217,12 +216,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download mobile-engage tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: mobile-engage

Expand All @@ -246,12 +245,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download predict tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: predict

Expand All @@ -275,12 +274,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download emarsys-sdk tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: emarsys-sdk

Expand All @@ -307,12 +306,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download emarsys tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: emarsys

Expand All @@ -336,12 +335,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download common tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: common

Expand All @@ -365,12 +364,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download emarsys-firebase tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: emarsys-firebase

Expand All @@ -394,12 +393,12 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: sample

- name: Download emarsys-huawei tests
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: emarsys-huawei

Expand All @@ -423,7 +422,7 @@ jobs:
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: mobile-sdk-sample

Expand All @@ -434,7 +433,7 @@ jobs:
json: ${{ secrets.GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON }}

- name: Playstore upload
uses: r0adkll/upload-google-play@v1.0.15
uses: r0adkll/upload-google-play@v1.1.3
with:
serviceAccountJson: google-play-services.json
packageName: com.emarsys.sample
Expand Down
Loading

0 comments on commit 0390e8f

Please sign in to comment.