|
1 | 1 | name: E2E tests |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
4 | 7 | workflow_dispatch: |
5 | 8 | schedule: |
6 | 9 | - cron: '30 2 * * 1-5' # Monday to Friday at 2:30AM |
7 | | - pull_request: |
8 | | - branches: |
9 | | - - master |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - |
13 | | - # Builds the app with QA variant and publish the apk |
14 | 12 | build_apk: |
15 | | - name: Build APK |
16 | | - runs-on: ubuntu-latest |
17 | | - outputs: |
18 | | - apk-path: ./src/test/resources/owncloud.apk |
19 | | - |
20 | | - steps: |
21 | | - - name: Checkout current repo |
22 | | - uses: actions/checkout@v4 |
23 | | - |
24 | | - - name: Clone external repo |
25 | | - run: git clone https://github.com/owncloud/android.git android-app |
26 | | - |
27 | | - - name: Setup JDK |
28 | | - uses: actions/setup-java@v4 |
29 | | - with: |
30 | | - distribution: 'temurin' |
31 | | - java-version: '17' |
32 | | - |
33 | | - - name: Cache Gradle |
34 | | - uses: actions/cache@v4 |
35 | | - with: |
36 | | - path: | |
37 | | - ~/.gradle/caches |
38 | | - ~/.gradle/wrapper |
39 | | - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
40 | | - restore-keys: | |
41 | | - ${{ runner.os }}-gradle- |
42 | | -
|
43 | | - - name: Build APK |
44 | | - working-directory: android-app |
45 | | - run: ./gradlew clean assembleqaRelease |
46 | | - |
47 | | - - name: Copy APK |
48 | | - id: set-output |
49 | | - run: | |
50 | | - cp ./android-app/owncloudApp/build/outputs/apk/qa/release/owncloud_*-qa-release*.apk ./src/test/resources/owncloud.apk |
51 | | - ls -al ./src/test/resources |
52 | | -
|
53 | | - - name: Upload APK |
54 | | - uses: actions/upload-artifact@v4 |
55 | | - with: |
56 | | - name: app-apk |
57 | | - path: ./src/test/resources/owncloud.apk |
58 | | - |
59 | | - run_tests: |
60 | | - name: Run Emulator & Execute Tests & Artifacts |
61 | | - needs: build_apk |
62 | | - runs-on: ubuntu-latest |
63 | | - env: |
64 | | - OC_SERVER_URL: ${{ secrets.OC_SERVER_URL }} |
65 | | - BACKEND: oCIS |
66 | | - |
67 | | - steps: |
68 | | - - name: Checkout current repo |
69 | | - uses: actions/checkout@v4 |
70 | | - |
71 | | - # Uploaded in the job above |
72 | | - - name: Download APK |
73 | | - uses: actions/download-artifact@v4 |
74 | | - with: |
75 | | - name: app-apk |
76 | | - path: ./src/test/resources |
77 | | - |
78 | | - # Improves emulator's performance by using hardware acceleration |
79 | | - - name: Enable KVM |
80 | | - run: | |
81 | | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
82 | | - sudo udevadm control --reload-rules |
83 | | - sudo udevadm trigger --name-match=kvm |
84 | | -
|
85 | | - - name: Start Appium |
86 | | - run: | |
87 | | - mkdir -p logs video |
88 | | - chmod +x ./runAppium.sh |
89 | | - ./runAppium.sh |
90 | | -
|
91 | | - - name: Run Emulator & Tests |
92 | | - uses: reactivecircus/android-emulator-runner@v2 |
93 | | - id: execution |
94 | | - with: |
95 | | - api-level: 31 |
96 | | - target: google_apis |
97 | | - arch: x86_64 |
98 | | - profile: pixel_5 |
99 | | - avd-name: test-avd |
100 | | - force-avd-creation: true |
101 | | - disable-animations: true |
102 | | - emulator-options: -no-snapshot -no-window -no-audio -no-boot-anim -accel on -memory 3072 |
103 | | - # Ignored tests, no oCIS tests and no CI tests will not run |
104 | | - script: ./executeTests -t "not @ignore and not @noocis and not @noci" |
105 | | - |
106 | | - - name: Upload html report |
107 | | - uses: actions/upload-artifact@v4 |
108 | | - if: always() |
109 | | - with: |
110 | | - name: report-html |
111 | | - path: target/my-report.html |
112 | | - |
113 | | - - name: Rename log file |
114 | | - if: always() |
115 | | - run: | |
116 | | - cp logs/*.log logs/log.log |
117 | | -
|
118 | | - - name: Upload Execution Log |
119 | | - if: always() |
120 | | - uses: actions/upload-artifact@v4 |
121 | | - with: |
122 | | - name: logs-dir |
123 | | - path: ./logs/log.log |
124 | | - |
125 | | - - name: Zip video files |
126 | | - if: always() |
127 | | - run: zip -r -9 test-recordings.zip video |
128 | | - |
129 | | - - name: Upload Video |
130 | | - if: always() |
131 | | - uses: actions/upload-artifact@v4 |
132 | | - with: |
133 | | - name: video-recordings |
134 | | - path: ./test-recordings.zip |
| 13 | + uses: ./.github/workflows/buildapk.yml |
| 14 | + |
| 15 | + tests: |
| 16 | + needs: |
| 17 | + - build_apk |
| 18 | + uses: ./.github/workflows/e2etests.yml |
| 19 | + with: |
| 20 | + apk: ${{ needs.build_apk.outputs.artifact-name }} |
| 21 | + backend: oCIS |
| 22 | + secrets: |
| 23 | + oc_server_url: ${{ secrets.OC_SERVER_URL }} |
0 commit comments