Skip to content

Commit f88d25f

Browse files
committed
Refactor archiving results
1 parent 206a1a8 commit f88d25f

3 files changed

Lines changed: 58 additions & 83 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Archive Test Results
2+
description: Archive runtime logs, screenshots, and artifacts from test runs
3+
inputs:
4+
platform:
5+
description: Platform (android or ios)
6+
required: true
7+
test-type:
8+
description: Test type (widget name or js-actions)
9+
required: true
10+
workspace-path:
11+
description: Workspace path for artifacts
12+
required: false
13+
default: ${{ github.workspace }}
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Archive runtime logs
19+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
20+
if: always()
21+
with:
22+
name: ${{ inputs.platform }}-runtime-logs-${{ inputs.test-type }}
23+
path: log/*.log
24+
if-no-files-found: ignore
25+
26+
- name: Archive test screenshots
27+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
28+
if: always()
29+
with:
30+
name: ${{ inputs.platform }}-screenshots-${{ inputs.test-type }}
31+
path: ${{ inputs.workspace-path }}/maestro/images/actual/${{ inputs.platform }}/**/*.png
32+
if-no-files-found: ignore
33+
34+
- name: Archive artifacts
35+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
36+
if: always()
37+
with:
38+
name: ${{ inputs.platform }}-artifacts-${{ inputs.test-type }}
39+
path: packages/pluggableWidgets/**/artifacts/
40+
if-no-files-found: ignore

.github/actions/setup-node-with-cache/action.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ runs:
77
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
88
with:
99
node-version-file: .nvmrc
10-
cache: yarn
1110

1211
- name: "Cache yarn dependencies"
1312
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4

.github/workflows/NativePipeline.yml

Lines changed: 18 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ jobs:
514514
- name: "Start runtime with retry"
515515
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
516516
with:
517-
timeout_minutes: 10
517+
timeout_minutes: 20
518518
max_attempts: 3
519519
command: |
520520
chmod +x .github/scripts/start-runtime-with-verification.sh
@@ -539,27 +539,11 @@ jobs:
539539
bash maestro/helpers/prepare_android.sh
540540
bash maestro/run_maestro_widget_tests.sh android "${{ matrix.widget }}"
541541
542-
- name: "Archive runtime logs"
543-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
544-
if: always()
545-
with:
546-
name: android-runtime-logs-${{ matrix.widget }}
547-
path: log/*.log
548-
if-no-files-found: ignore
549-
- name: "Archive test screenshots"
550-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
551-
if: always()
542+
- name: Archive test results
543+
uses: ./.github/actions/archive-test-results
552544
with:
553-
name: android-screenshots-${{ matrix.widget }}
554-
path: ${{ github.workspace }}/maestro/images/actual/android/**/*.png
555-
if-no-files-found: ignore
556-
- name: "Archive artifacts"
557-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
558-
if: always()
559-
with:
560-
name: android-artifacts-${{ matrix.widget }}
561-
path: packages/pluggableWidgets/**/artifacts/
562-
if-no-files-found: ignore
545+
platform: android
546+
test-type: ${{ matrix.widget }}
563547

564548
ios-widget-tests:
565549
needs: [scope, mendix-version, project, ios-app]
@@ -617,27 +601,11 @@ jobs:
617601
bash maestro/helpers/prepare_ios.sh
618602
bash maestro/run_maestro_widget_tests.sh ios "${{ matrix.widget }}"
619603
620-
- name: "Archive runtime logs"
621-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
622-
if: always()
604+
- name: Archive test results
605+
uses: ./.github/actions/archive-test-results
623606
with:
624-
name: ios-runtime-logs-${{ matrix.widget }}
625-
path: log/*.log
626-
if-no-files-found: ignore
627-
- name: "Archive test screenshots"
628-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
629-
if: always()
630-
with:
631-
name: ios-screenshots-${{ matrix.widget }}
632-
path: ${{ github.workspace }}/maestro/images/actual/ios/**/*.png
633-
if-no-files-found: ignore
634-
- name: "Archive artifacts"
635-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
636-
if: always()
637-
with:
638-
name: ios-artifacts-${{ matrix.widget }}
639-
path: packages/pluggableWidgets/**/artifacts/
640-
if-no-files-found: ignore
607+
platform: ios
608+
test-type: ${{ matrix.widget }}
641609

642610
android-js-tests:
643611
if: ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}}
@@ -679,7 +647,7 @@ jobs:
679647
- name: "Run android tests"
680648
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.0.0
681649
with:
682-
api-level: 30
650+
api-level: 35
683651
target: google_apis
684652
arch: x86_64
685653
profile: pixel
@@ -691,27 +659,11 @@ jobs:
691659
bash maestro/helpers/prepare_android.sh
692660
bash maestro/run_maestro_jsactions_tests.sh android
693661
694-
- name: "Archive runtime logs"
695-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
696-
if: always()
697-
with:
698-
name: android-runtime-logs-js-actions
699-
path: log/*.log
700-
if-no-files-found: ignore
701-
- name: "Archive test screenshots"
702-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
703-
if: always()
662+
- name: Archive test results
663+
uses: ./.github/actions/archive-test-results
704664
with:
705-
name: android-screenshots-js-actions
706-
path: ${{ github.workspace }}/maestro/images/actual/android/**/*.png
707-
if-no-files-found: ignore
708-
- name: "Archive artifacts"
709-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
710-
if: always()
711-
with:
712-
name: android-artifacts-js-actions
713-
path: packages/pluggableWidgets/**/artifacts/
714-
if-no-files-found: ignore
665+
platform: android
666+
test-type: js-actions
715667

716668
ios-js-tests:
717669
if: ${{ github.event.inputs.workspace == '*-native' || github.event_name == 'schedule' || github.event.inputs.workspace == 'js-actions'}}
@@ -755,27 +707,11 @@ jobs:
755707
bash maestro/helpers/prepare_ios.sh
756708
bash maestro/run_maestro_jsactions_tests.sh ios
757709
758-
- name: "Archive runtime logs"
759-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
760-
if: always()
710+
- name: Archive test results
711+
uses: ./.github/actions/archive-test-results
761712
with:
762-
name: ios-runtime-logs-js-actions
763-
path: log/*.log
764-
if-no-files-found: ignore
765-
- name: "Archive test screenshots"
766-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
767-
if: always()
768-
with:
769-
name: ios-screenshots-js-actions
770-
path: ${{ github.workspace }}/maestro/images/actual/ios/**/*.png
771-
if-no-files-found: ignore
772-
- name: "Archive artifacts"
773-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #v4
774-
if: always()
775-
with:
776-
name: ios-artifacts-js-actions
777-
path: packages/pluggableWidgets/**/artifacts/
778-
if-no-files-found: ignore
713+
platform: ios
714+
test-type: js-actions
779715
compare-screenshots:
780716
needs: [scope, android-widget-tests, ios-widget-tests, android-js-tests, ios-js-tests]
781717
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)