Skip to content
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: Zephyr Repack Plugin E2E testing #8

Merged
merged 122 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
37d458f
chore: enable usage of Zephyr plugin on e2e GH actions
MikitasK Jan 20, 2025
8bc33da
ci: configure running E2E test on CI for both Debug and Release modes
MikitasK Jan 21, 2025
4e635c5
ci: create new Build Zephyr Repack Plugin action
MikitasK Jan 21, 2025
12d1df5
ci: create new Zephyr Repack Plugin E2E testing workflow
MikitasK Jan 21, 2025
02b3e39
ci: add new 'Update Zephyr Repack Plugin version' step to the workflow
MikitasK Jan 21, 2025
30ba3a8
fix: syntax error
Esemesek Jan 23, 2025
6b9121f
chore: add inputs to workflows
Esemesek Jan 23, 2025
5f68950
fix: add missing inputs keyword
Esemesek Jan 23, 2025
88b2b88
fix: change type of input
Esemesek Jan 23, 2025
55b0e92
chore: trigger zephyr deployment
Esemesek Jan 24, 2025
0556bf3
chore: echo token
Esemesek Jan 24, 2025
748a163
chore: fix passing the token
Esemesek Jan 24, 2025
81430b1
chore: move pipeline
Esemesek Jan 24, 2025
9252c72
chore: try permissions
Esemesek Jan 24, 2025
a3086f3
chore: remove permissions block
Esemesek Jan 24, 2025
e04c498
chore: try passing var in parent workflow
Esemesek Jan 24, 2025
752bfdc
chore: pass env var as input
Esemesek Jan 24, 2025
e555fac
fix: pass secrets explicitly
Esemesek Jan 24, 2025
8322e78
fix: token
Esemesek Jan 24, 2025
6e24428
fix: build with token and ZC set to true
Esemesek Jan 24, 2025
a3365e5
fix: pass token to test command
Esemesek Jan 24, 2025
6539b22
fix: add timeout
Esemesek Jan 24, 2025
0c3a3f6
ci: revert back to use development server at the 'ios maestro tests' …
MikitasK Jan 27, 2025
46dbcc3
ci: run e2e tests for both platforms at the 'test-zephyr-repack-plugi…
MikitasK Jan 27, 2025
5b0902e
ci: temporary trigger 'test-zephyr-repack-plugin' pipeline on PR to main
MikitasK Jan 27, 2025
6e70e52
style: add missed 'required' props for pipeline args
MikitasK Jan 27, 2025
76be1a9
ci: disable e2e tests on 'debug' mode for Android
MikitasK Jan 27, 2025
551e496
ci: make mobile-e2e-trigger pipeline reusable
MikitasK Jan 27, 2025
71ea24d
ci: build zephyr-repack-plugin from main branch of zephyr-packages re…
MikitasK Jan 27, 2025
2662461
ci: build zephyr-repack-plugin from master branch
MikitasK Jan 27, 2025
e8ddd7b
style: remove completed TODO comment
MikitasK Jan 27, 2025
290403a
ci: run "align-deps" after installing @rnx-kit/align-deps
MikitasK Jan 27, 2025
4463236
ci: update 'update-zephyr-repack-plugin-version' script
MikitasK Jan 27, 2025
6715210
ci: set MAESTRO_DRIVER_STARTUP_TIMEOUT variable for iOS e2e tests pip…
MikitasK Jan 27, 2025
c06be2d
ci: return package.json of mobile-host
MikitasK Jan 27, 2025
fba9d31
ci: return devDependencies.json
MikitasK Jan 27, 2025
5ccb15c
ci: update 'build-zephyr-repack-plugin' action
MikitasK Jan 27, 2025
fb46305
ci: update e2e-android/ios workflows with 'Build Zephyr Repack Plugin…
MikitasK Jan 27, 2025
0475c3d
ci: update and rename 'test-zephyr-repack-plugin' workflow
MikitasK Jan 27, 2025
3551c3f
ci: rename 'test-zephyr-repack-plugin' workflow configure its trigger…
MikitasK Jan 27, 2025
0e9041c
ci: adjust 'build-zephyr-repack-plugin-locally' arg at the e2e-zephyr…
MikitasK Jan 27, 2025
4ea0e96
ci: update setup-dependencies action
MikitasK Jan 27, 2025
da8838c
ci: add 'Align Dependencies' step to the e2e-android/ios workflows
MikitasK Jan 27, 2025
2522ee2
ci: move 'build-zephyr-plugin-locally' specific steps after setting u…
MikitasK Jan 27, 2025
dec7086
ci: disable Pods caching
MikitasK Jan 28, 2025
b7dffa9
ci: increase ios-e2e-tests job timeout
MikitasK Jan 28, 2025
fe782be
ci: increase MAESTRO_DRIVER_STARTUP_TIMEOUT at the ios-e2e-tests job
MikitasK Jan 28, 2025
e907b27
ci: temporary disable Zephyr Repack Plugin and Release mode running
MikitasK Jan 28, 2025
3d4e5ee
style: move Align Dependencies step to the build-zephyr-repack-plugin…
MikitasK Jan 28, 2025
e15572f
ci: remove passing env vars to the run-maestro-test scripts
MikitasK Jan 28, 2025
df43b4a
ci: add --no-frozen-lockfile arg at pnpm i
MikitasK Jan 28, 2025
7c58634
ci: move installation of concurrently to the run-maestro-tests scripts
MikitasK Jan 28, 2025
60bae61
ci: run E2E tests on Release mode w Zephyr Repack Plugin enabled
MikitasK Jan 28, 2025
86c00c7
ci: add timeout for e2e-android workflow
MikitasK Jan 29, 2025
fea6013
ci: disable android emulator caching on e2e-android workflow
MikitasK Jan 29, 2025
dc21808
Merge branch 'main' into bootstrap-example
MikitasK Jan 29, 2025
4e79b9b
test: fix common 'login' maestro flow
MikitasK Jan 29, 2025
48d01ad
fix: fix android CLEARTEXT error on app launch in release mode
MikitasK Jan 29, 2025
d0fc690
Revert "feat: upgrade repack to rc7"
MikitasK Jan 29, 2025
0355ed6
ci: remove adbreverse step from run-android-maestro-tests script
MikitasK Jan 30, 2025
f2129a1
chore: update lottie-rn and @callstack/repack packages
MikitasK Jan 30, 2025
cff09c9
chore: increase e2e-ios job timeout
MikitasK Jan 30, 2025
aa10bce
chore: revert back repack version
MikitasK Jan 30, 2025
6352001
revert: repack 5.0.0-rc.10 version without patch
MikitasK Jan 30, 2025
9d8a9c1
Merge branch 'main' into bootstrap-example
MikitasK Jan 30, 2025
66babb1
chore: update lock files
MikitasK Jan 30, 2025
43d6df6
revert: repack v.5.0.0-rc.3 with patch
MikitasK Jan 31, 2025
b2882df
revert: repack v.5.0.0-rc.10 with patch
MikitasK Jan 31, 2025
dc20fb1
ci: disable local zephyr-repack-plugin building
MikitasK Jan 31, 2025
d95dc26
ci: zephyr-repack-plugin v.0.0.0-canary-20250130213446
MikitasK Jan 31, 2025
bcb49dc
ci: zephyr-repack-plugin v.0.0.0-canary-20250121175535
MikitasK Jan 31, 2025
a7fb4b8
Merge branch 'main' into bootstrap-example
MikitasK Jan 31, 2025
37659d1
chore: pnpm-lock.yaml file update
MikitasK Jan 31, 2025
531a734
ci: zephyr-repack-plugin v.0.0.0-canary-20250130213446
MikitasK Jan 31, 2025
b575e11
ci: zephyr-repack-plugin v.0.0.0-canary-20241121202227
MikitasK Jan 31, 2025
6aaf919
Revert "fix: patch bundle analyzer"
MikitasK Jan 31, 2025
af4c638
Revert "chore: configure rsdoctor and upgrade repack"
MikitasK Jan 31, 2025
827bd8e
ci: zephyr-repack-plugin v.0.0.0-canary-20250130213446
MikitasK Jan 31, 2025
7165b0d
ci: zephyr-repack-plugin v.0.0.0-canary-20241121202227
MikitasK Jan 31, 2025
ddba962
revert: adbreverse step at the run-android-maestro-tests script
MikitasK Jan 31, 2025
5274624
revert: zephyr-deployment step on e2e-zephyr-repack-plugin workflow
MikitasK Jan 31, 2025
630c657
chore: zephyr-repack-plugin v.0.0.0-canary-20250117215906
MikitasK Jan 31, 2025
ddec0c5
chore: zephyr-repack-plugin v.0.0.0-canary-20250130213446
MikitasK Jan 31, 2025
42aba4d
ci: local zephyr-repack-plugin build without zephyr-deployment step
MikitasK Jan 31, 2025
90bd264
revert: local zephyr-repack-plugin build with zephyr-deployment step
MikitasK Feb 3, 2025
3db8dbc
ci: disable local zephyr-repack-plugin building
MikitasK Feb 3, 2025
bb0120e
chore: remove repack patch
MikitasK Feb 3, 2025
6e28f09
chore: update react-native version and remove rn-community-cli-plugin…
MikitasK Feb 3, 2025
8e5a91f
ci: enable local zephyr-repack-plugin building
MikitasK Feb 3, 2025
e8eff4a
ci: disable zephyr-deployment step
MikitasK Feb 3, 2025
c958693
ci: run ios e2e tests job after android one
MikitasK Feb 3, 2025
9e7e6cb
ci: enable zephyr-deployment step
MikitasK Feb 3, 2025
4e3a488
ci: run ios e2e tests job even if android one is failed
MikitasK Feb 3, 2025
4085e83
ci: 'bundle:android' on zephyr-deployment workflow
MikitasK Feb 3, 2025
4830b97
ci: add platform input to the zephyr-deployment workflow
MikitasK Feb 3, 2025
68666b8
ci: run zephyr-deployment-ios job after android-tests one
MikitasK Feb 3, 2025
de26dc8
ci: 'platform' input at zephyr-deployment-ios job
MikitasK Feb 3, 2025
a4eaabe
ci: disable zephyr-deployment jobs
MikitasK Feb 4, 2025
8abeaac
ci: enable zephyr-deployment-android job
MikitasK Feb 4, 2025
06cf41c
ci: enable zephyr-deployment-ios job
MikitasK Feb 4, 2025
e204a68
ci: run android-tests eve if prev jobs are failed
MikitasK Feb 4, 2025
ece3d13
ci: trigger e2e-zephyr-repack-plugin workflow from zephyr-packages repo
MikitasK Feb 4, 2025
ca8e0ed
ci: trigger e2e-zephyr-repack-plugin workflow on dispatch
MikitasK Feb 4, 2025
9799acb
ci: temporary simulate e2e tests failure/success
MikitasK Feb 5, 2025
12abd84
ci: trigger results workflow in `zephyr-packages` repo
MikitasK Feb 5, 2025
20c3f10
ci: replace jobs simulation with original jobs; add 'report-status' job
MikitasK Feb 5, 2025
489af51
chore: rsdoctor with adjusted config
MikitasK Feb 6, 2025
9fa14b5
chore: rspack and mfe upgrade
MikitasK Feb 6, 2025
f9ca9f7
chore: adjust rspack config
MikitasK Feb 6, 2025
4a0e075
chore: packages upgrade
MikitasK Feb 6, 2025
48e53d2
ci: android emulator caching on e2e-android workflow
MikitasK Feb 6, 2025
5231d03
ci: pods caching on e2e-ios workflow
MikitasK Feb 6, 2025
a19ff26
style: remove redundant comments on build-zephyr-repack-plugin action
MikitasK Feb 6, 2025
036e1f0
Merge branch 'main' into bootstrap-example
MikitasK Feb 6, 2025
eb08b5e
chore: update pnpm-lock.yaml
MikitasK Feb 6, 2025
288d8f9
revert: mfe version
MikitasK Feb 7, 2025
01bcb3a
chore: update pnpm-lock.yaml
MikitasK Feb 7, 2025
b35152b
ci: new GH_TOKEN for 'report results' step on e2e workflow
MikitasK Feb 11, 2025
29c9ed6
ci: temporary trigger workflow personal zephyr-packages fork at e2e w…
MikitasK Feb 11, 2025
63f3751
ci: temporary simulate e2e workflow jobs completion
MikitasK Feb 11, 2025
772659c
Revert "ci: temporary simulate e2e workflow jobs completion"
MikitasK Feb 11, 2025
fba1cc9
Revert "ci: temporary trigger workflow personal zephyr-packages fork …
MikitasK Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/actions/build-zephyr-repack-plugin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Zephyr Repack Plugin
description: Sets up the "zephyr-packages" dependencies and builds Zephyr Repack Plugin locally

runs:
using: "composite"
steps:

- name: Add "zephyr-packages" repo as submodule
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
run: |
REPO_URL="https://${GITHUB_TOKEN}@github.com/ZephyrCloudIO/zephyr-packages.git"
git submodule add -b master $REPO_URL submodules/zephyr-packages
git submodule update --init --recursive
shell: bash

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- uses: actions/setup-node@v4
name: Install Node.js
with:
node-version-file: '.node-version'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Install "zephyr-packages" dependencies
working-directory: submodules/zephyr-packages
run: pnpm i
shell: bash

- name: Build Zephyr Repack Plugin
working-directory: submodules/zephyr-packages/libs/zephyr-repack-plugin
run: pnpm build
shell: bash

- name: Update Zephyr Repack Plugin version
run: |
chmod +x ./.github/scripts/update-zephyr-repack-plugin-version.sh
./.github/scripts/update-zephyr-repack-plugin-version.sh
cat ./packages/mobile-sdk/lib/devDependencies.json
shell: bash

- name: Align Dependencies
run: |
pnpm align-deps
cat ./apps/mobile-host/package.json
pnpm i --no-frozen-lockfile
shell: bash
4 changes: 1 addition & 3 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,5 @@ runs:
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Install dependencies
run: |
pnpm install --prefer-offline --frozen-lockfile
pnpm install -g concurrently
run: pnpm install --prefer-offline --frozen-lockfile
shell: bash
29 changes: 0 additions & 29 deletions .github/actions/zephyr-deployment/action.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/scripts/run-android-maestro-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ echo "🚀 Starting Android Maestro tests..."

# Start the mobile servers in the background
echo "🔧 Starting mobile servers..."
pnpm run start:mobile:concurrently & # runs in background
pnpm install -g concurrently
ZC="$ZC" ZE_SECRET_TOKEN="$ZE_SECRET_TOKEN" pnpm run start:mobile:concurrently & # runs in background
echo "✅ Mobile servers started successfully."

# Run adb reverse scripts to set up port forwarding
Expand All @@ -29,7 +30,7 @@ echo "✅ adbreverse executed successfully."

# Build and install the mobile app on the device
echo "📱 Building and installing the app on the device..."
pnpm run:mobile-host:android
pnpm run:mobile-host:android --mode="$MODE"
echo "✅ App built and installed successfully."

# Run the end-to-end test scripts
Expand Down
5 changes: 3 additions & 2 deletions .github/scripts/run-ios-maestro-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ echo "🚀 Starting iOS Maestro tests..."

# Start the mobile servers in the background
echo "🔧 Starting mobile servers..."
pnpm run start:mobile:concurrently & # runs in background
pnpm install -g concurrently
ZC="$ZC" ZE_SECRET_TOKEN="$ZE_SECRET_TOKEN" pnpm run start:mobile:concurrently & # runs in background
echo "✅ Mobile servers started successfully."

# Build and install the mobile app on the device
echo "📱 Building and installing the app on the device..."
pnpm run:mobile-host:ios --simulator="$SIMULATOR_NAME"
pnpm run:mobile-host:ios --simulator="$SIMULATOR_NAME" --mode="$MODE"
echo "✅ App built and installed successfully."

# Run the end-to-end test scripts
Expand Down
22 changes: 22 additions & 0 deletions .github/scripts/update-zephyr-repack-plugin-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

DEV_DEPS="packages/mobile-sdk/lib/devDependencies.json"

# Backup the original devDependencies file
cp "$DEV_DEPS" "$DEV_DEPS.bak"

# Read devDependencies file into a variable and update it
UPDATED_DEV_DEPS=$(while IFS= read -r line; do
if echo "$line" | grep -q '"zephyr-repack-plugin"'; then
echo "$line"
echo ' "name": "zephyr-repack-plugin",'
echo ' "version": "../../submodules/zephyr-packages/libs/zephyr-repack-plugin",'
echo ' "devOnly": true'
while IFS= read -r skip_line && [[ ! "$skip_line" =~ ^[[:space:]]*} ]]; do :; done
echo "$skip_line"
else
echo "$line"
fi
done < "$DEV_DEPS")

echo "$UPDATED_DEV_DEPS" > "$DEV_DEPS"
26 changes: 24 additions & 2 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
name: E2E Android Tests

on: [workflow_call]
on:
workflow_call:
secrets:
ZE_SECRET_TOKEN:
required: true
description: "Zephyr secret token"
inputs:
build-zephyr-repack-plugin-locally:
required: false
type: boolean
default: false

jobs:
android-e2e-tests:
timeout-minutes: 30 # Set a timeout for the job to prevent it from running indefinitely
runs-on: ubuntu-latest
env:
MAESTRO_VERSION: 1.39.4
Expand Down Expand Up @@ -54,8 +65,18 @@ jobs:
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: echo "Generated AVD snapshot for caching."

- name: Run Android E2E Tests
- name: Build Zephyr Repack Plugin locally
if: ${{ inputs.build-zephyr-repack-plugin-locally }}
uses: ./.github/actions/build-zephyr-repack-plugin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Android E2E Tests on Release Mode
uses: reactivecircus/android-emulator-runner@v2
env:
ZC: 1
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}
MODE: 'release'
with:
api-level: ${{ env.ANDROID_EMULATOR_API_LEVEL }}
target: ${{ env.ANDROID_EMULATOR_TARGET }}
Expand All @@ -65,6 +86,7 @@ jobs:
script: |
chmod +x ./.github/scripts/run-android-maestro-tests.sh
./.github/scripts/run-android-maestro-tests.sh

- name: Upload Maestro Logs on Failure
if: failure() # Runs only if any of the previous steps fail
uses: actions/upload-artifact@v4
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
name: E2E iOS Tests

on: [workflow_call]
on:
workflow_call:
secrets:
ZE_SECRET_TOKEN:
required: true
description: "Zephyr secret token"
inputs:
build-zephyr-repack-plugin-locally:
required: false
type: boolean
default: false

jobs:
ios-e2e-tests:
timeout-minutes: 60 # Set a timeout for the job to prevent it from running indefinitely
runs-on: macos-latest
env:
RUBY_VERSION: 2.7.6
MAESTRO_VERSION: 1.39.4
SIMULATOR_NAME: "iPhone 15 Pro Max"
MAESTRO_DRIVER_STARTUP_TIMEOUT: 240000
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -34,12 +46,22 @@ jobs:
path: apps/mobile-host/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('apps/mobile-host/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
${{ runner.os }}-pods-

- name: Build Zephyr Repack Plugin locally
if: ${{ inputs.build-zephyr-repack-plugin-locally }}
uses: ./.github/actions/build-zephyr-repack-plugin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Pods
run: pnpm --filter MobileHost pods

- name: Run iOS E2E Tests
- name: Run iOS E2E Tests on Release Mode
env:
ZC: 1
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}
MODE: 'Release'
run: |
chmod +x ./.github/scripts/run-ios-maestro-tests.sh
./.github/scripts/run-ios-maestro-tests.sh
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/e2e-mobile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Mobile E2E Tests Trigger

on: [workflow_dispatch]

jobs:
zephyr-deployment:
uses: ./.github/workflows/zephyr-deployment.yml
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}

ios-tests:
needs: zephyr-deployment
uses: ./.github/workflows/e2e-ios.yml
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}

android-tests:
needs: zephyr-deployment
uses: ./.github/workflows/e2e-android.yml
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}
106 changes: 106 additions & 0 deletions .github/workflows/e2e-zephyr-repack-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Zephyr Repack Plugin E2E testing

on:
workflow_dispatch:

jobs:
zephyr-deployment-ios:
uses: ./.github/workflows/zephyr-deployment.yml
with:
platform: ios
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}

ios-tests:
needs: zephyr-deployment-ios
uses: ./.github/workflows/e2e-ios.yml
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}
with:
build-zephyr-repack-plugin-locally: true

zephyr-deployment-android:
if: always()
needs: ios-tests
uses: ./.github/workflows/zephyr-deployment.yml
with:
platform: android
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}

android-tests:
if: always()
needs: zephyr-deployment-android
uses: ./.github/workflows/e2e-android.yml
secrets:
ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }}
with:
build-zephyr-repack-plugin-locally: true

report-status:
if: always()
needs: [zephyr-deployment-ios, ios-tests, zephyr-deployment-android, android-tests]
runs-on: ubuntu-latest
steps:
- name: Generate Job Statuses and Log Links
id: collect-status
run: |
echo "ZE_DEPLOYMENT_IOS=${{ needs.zephyr-deployment-ios.result }}" >> $GITHUB_ENV
echo "IOS_TESTS=${{ needs.ios-tests.result }}" >> $GITHUB_ENV
echo "ZE_DEPLOYMENT_ANDROID=${{ needs.zephyr-deployment-android.result }}" >> $GITHUB_ENV
echo "ANDROID_TESTS=${{ needs.android-tests.result }}" >> $GITHUB_ENV

if [[ "${{ needs.zephyr-deployment-ios.result }}" == "success" && \
"${{ needs.ios-tests.result }}" == "success" && \
"${{ needs.zephyr-deployment-android.result }}" == "success" && \
"${{ needs.android-tests.result }}" == "success" ]]; then
echo "WORKFLOW_STATUS=success" >> $GITHUB_ENV
else
echo "WORKFLOW_STATUS=failure" >> $GITHUB_ENV
fi

- name: Generate Job Log Links
id: collect-logs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get job details from GitHub API
JOBS_JSON=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs --jq '.jobs')

# Extract job IDs based on job names
IOS_ZEPHYR_DEPLOYMENT_JOB_ID=$(echo "$JOBS_JSON" | jq -r '.[] | select(.name == "zephyr-deployment-ios") | .id')
ANDROID_ZEPHYR_DEPLOYMENT_JOB_ID=$(echo "$JOBS_JSON" | jq -r '.[] | select(.name == "zephyr-deployment-android") | .id')
IOS_TESTS_JOB_ID=$(echo "$JOBS_JSON" | jq -r '.[] | select(.name == "ios-tests") | .id')
ANDROID_TESTS_JOB_ID=$(echo "$JOBS_JSON" | jq -r '.[] | select(.name == "android-tests") | .id')

# Construct job log URLs
echo "IOS_DEPLOYMENT_LOGS=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${IOS_ZEPHYR_DEPLOYMENT_JOB_ID}" >> $GITHUB_ENV
echo "IOS_TESTS_LOGS=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${IOS_TESTS_JOB_ID}" >> $GITHUB_ENV
echo "ANDROID_DEPLOYMENT_LOGS=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${ANDROID_ZEPHYR_DEPLOYMENT_JOB_ID}" >> $GITHUB_ENV
echo "ANDROID_TESTS_LOGS=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${ANDROID_TESTS_JOB_ID}" >> $GITHUB_ENV

- name: Report Results to `zephyr-packages`
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'ZephyrCloudIO',
repo: 'zephyr-packages',
workflow_id: 'zephyr_repack_plugin_e2e_results.yml',
ref: 'ci/zephyr-repack-plugin-e2e-trigger',
inputs: {
workflow_status: "${{ env.WORKFLOW_STATUS }}",
run_url: "https://github.com/ZephyrCloudIO/zephyr-repack-example/actions/runs/${{ github.run_id }}",
zephyr_deployment_ios_status: "${{ env.ZE_DEPLOYMENT_IOS }}",
ios_tests_status: "${{ env.IOS_TESTS }}",
zephyr_deployment_android_status: "${{ env.ZE_DEPLOYMENT_ANDROID }}",
android_tests_status: "${{ env.ANDROID_TESTS }}",
ios_deployment_logs_url: "${{ env.IOS_DEPLOYMENT_LOGS }}",
ios_tests_logs_url: "${{ env.IOS_TESTS_LOGS }}",
android_deployment_logs_url: "${{ env.ANDROID_DEPLOYMENT_LOGS }}",
android_tests_logs_url: "${{ env.ANDROID_TESTS_LOGS }}"
}
});


Loading
Loading