Skip to content

Commit 25408f9

Browse files
authored
Merge pull request #4677 from owncloud/feature/improve_update_test
[FEATURE] Improve update test
2 parents 65684fb + 44301f3 commit 25408f9

4 files changed

Lines changed: 51 additions & 38 deletions

File tree

‎.github/workflows/build-apk-from-latest.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
tags:
77
- latest
88
schedule:
9-
# Runs on the 1st day of every 2 months at 00:00 UTC
10-
- cron: "0 0 1 */2 *"
9+
# Runs Saturdays 21:00 UTC
10+
- cron: "0 21 * * 6"
1111

1212
permissions:
1313
# Only need read access to repository contents
@@ -101,5 +101,5 @@ jobs:
101101
with:
102102
name: owncloudSigned-latest
103103
path: ./owncloudSigned-latest.apk
104-
retention-days: 90
104+
retention-days: 7
105105

‎.github/workflows/update.yml‎

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,24 @@ on:
1313
permissions:
1414
# Only need read access to repository contents
1515
contents: read
16+
actions: read
1617

1718
jobs:
18-
build_apks:
19+
build_and_test:
1920
# Job to build APKs for the latest commit and the commit that triggered the workflow
20-
name: Build APKs
21+
name: Build and Test
2122
runs-on: ubuntu-latest
22-
strategy:
23-
matrix:
24-
# Run matrix for latest commit on branch and current commit SHA
25-
commit: ["latest", "${{ github.sha }}"]
26-
23+
2724
env:
2825
BUILD_TOOLS_VERSION: "34.0.0"
26+
GITHUB_SHA: ${{ github.sha }}
2927

3028
steps:
31-
# Checkout the specific commit from matrix
29+
# Checkout the specific commit
3230
- name: Checkout specific commit
3331
uses: actions/checkout@v5
3432
with:
35-
ref: ${{ matrix.commit }}
33+
ref: ${{ github.sha }}
3634

3735
# Set up Java JDK required for Gradle
3836
- name: Set up JDK
@@ -43,7 +41,7 @@ jobs:
4341

4442
# Set up Android SDK and build tools
4543
- name: Set up Android SDK
46-
uses: android-actions/setup-android@v2
44+
uses: android-actions/setup-android@v3
4745

4846
# Cache Gradle dependencies to speed up builds
4947
- name: Cache Gradle
@@ -62,7 +60,7 @@ jobs:
6260

6361
# Copy the built APK to a commit-specific name
6462
- name: Get apk
65-
run: cp owncloudApp/build/outputs/apk/qa/release/owncloud_*-qa-release*.apk owncloud-${{ matrix.commit }}.apk
63+
run: cp owncloudApp/build/outputs/apk/qa/release/owncloud_*-qa-release*.apk owncloud-${{ github.sha }}.apk
6664

6765
# Decode keystore from secret for signing
6866
- name: Restore keystore
@@ -72,9 +70,9 @@ jobs:
7270
# Align and sign the APK
7371
- name: Sign APK
7472
run: |
75-
APK_INPUT="owncloud-${{ matrix.commit }}.apk"
76-
APK_ALIGNED="owncloud-${{ matrix.commit }}-aligned.apk"
77-
APK_SIGNED="owncloudSigned-${{ matrix.commit }}.apk"
73+
APK_INPUT="owncloud-${{ github.sha }}.apk"
74+
APK_ALIGNED="owncloud-${{ github.sha }}-aligned.apk"
75+
APK_SIGNED="owncloudSigned-${{ github.sha }}.apk"
7876
KEYSTORE="./test.keystore"
7977
KEY_ALIAS="${{ secrets.TEST_KS_ALIAS }}"
8078
KEY_PASSWORD="${{ secrets.TEST_KS_KEY }}"
@@ -103,40 +101,33 @@ jobs:
103101
- name: Upload APK as artifact
104102
uses: actions/upload-artifact@v4
105103
with:
106-
name: owncloudSigned-${{ matrix.commit }}
107-
path: ./owncloudSigned-${{ matrix.commit }}.apk
108-
# Removed after 1 day
104+
name: owncloudSigned-${{ github.sha }}
105+
path: ./owncloudSigned-${{ github.sha }}.apk
109106
retention-days: 1
110107

111-
execute_tests:
112-
# Job to run tests using the APKs built in previous job
113-
name: Execute tests
114-
needs: build_apks
115-
runs-on: ubuntu-latest
116-
117-
env:
118-
GITHUB_SHA: ${{ github.sha }}
119-
120-
steps:
121-
122108
# Clean up the workspace
123109
- name: Clean up
124-
run: rm -rf ${{ github.workspace }}/*
110+
run: |
111+
rm -rf ${{ github.workspace }}/*
112+
rm -rf ${{ github.workspace }}/.[!.]*
113+
rm -rf ${{ github.workspace }}/..?*
125114
126115
# Clone repository containing update tests
127116
- name: Clone tests repo
128117
run: git clone https://github.com/owncloud/android-update-testing.git .
129118

130-
# Download APK built from latest commit
131-
- name: Get apk built from latest
132-
uses: actions/download-artifact@v4
119+
# Download APK built last latest signing
120+
- name: Download latest signed APK
121+
uses: dawidd6/action-download-artifact@v11
133122
with:
123+
workflow: build-apk-from-latest.yml
134124
name: owncloudSigned-latest
125+
workflow_conclusion: success
135126
path: ./src/test/resources
136127

137128
# Download APK built from current commit
138129
- name: Get apk built from current
139-
uses: actions/download-artifact@v4
130+
uses: actions/download-artifact@v5
140131
with:
141132
name: owncloudSigned-${{ github.sha }}
142133
path: ./src/test/resources
@@ -154,7 +145,7 @@ jobs:
154145
run: |
155146
mkdir -p logs video
156147
chmod +x ./runAppium.sh
157-
./runAppium.sh &
148+
./runAppium.sh
158149
159150
# Enable KVM for emulator acceleration
160151
- name: Enable KVM
@@ -208,12 +199,20 @@ jobs:
208199
name: logs
209200
path: ./logs/log.log
210201

202+
# Upload appium log
203+
- name: Upload Appium Log
204+
if: always()
205+
uses: actions/upload-artifact@v4
206+
with:
207+
name: appium
208+
path: ./appium.log
209+
211210
# Prepare video file to be uploaded by compressing it
212211
- name: Zip video files
213212
if: always()
214213
run: zip -r -9 test-recording.zip video || true
215214

216-
# Upload video file
215+
# Upload video file
217216
- name: Upload Video
218217
if: always()
219218
uses: actions/upload-artifact@v4

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ ownCloud admins and users.
4242
* Bugfix - Set authorization header for token request only when necessary: [#4575](https://github.com/owncloud/android/issues/4575)
4343
* Bugfix - Add explicit permission to Detekt workflow: [#4675](https://github.com/owncloud/android/pull/4675)
4444
* Change - SBOM workflow runs on dependabot PRs: [#4664](https://github.com/owncloud/android/pull/4664)
45+
* Change - Update test workflow uses "build-from-latest-apk" workflow: [#4681](https://github.com/owncloud/android/pull/4681)
4546
* Enhancement - New layout for spaces list: [#4604](https://github.com/owncloud/android/issues/4604)
4647
* Enhancement - Add account ID to the user information: [#4605](https://github.com/owncloud/android/issues/4605)
4748
* Enhancement - Update test in GitHub Actions: [#4663](https://github.com/owncloud/android/pull/4663)
@@ -74,6 +75,14 @@ ownCloud admins and users.
7475
https://github.com/owncloud/android/pull/4664
7576
https://github.com/owncloud/android/pull/4666
7677

78+
* Change - Update test workflow uses "build-from-latest-apk" workflow: [#4681](https://github.com/owncloud/android/pull/4681)
79+
80+
Workflow for update testing has been changed in order to build now only over the
81+
current commit, taking "latest" from the existing workflow
82+
"build-from-latest-apk", that runs periodically.
83+
84+
https://github.com/owncloud/android/pull/4681
85+
7786
* Enhancement - New layout for spaces list: [#4604](https://github.com/owncloud/android/issues/4604)
7887

7988
A three-dot button has been added to each space card, allowing a bottom sheet

‎changelog/unreleased/4667‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Change: Update test workflow uses "build-from-latest-apk" workflow
2+
3+
Workflow for update testing has been changed in order to build now only over the current commit, taking "latest" from the existing workflow "build-from-latest-apk", that runs periodically.
4+
5+
https://github.com/owncloud/android/pull/4681

0 commit comments

Comments
 (0)