Repository navigation
61 lines (58 loc) · 2.5 KB
/
Copy pathe2e-build.yml
File metadata and controls
61 lines (58 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: E2E Build
on:
workflow_call:
env:
# The Gradle build cache comes from the Actions cache below instead of S3.
GRADLE_LOCAL_BUILD_CACHE: 'true'
jobs:
build:
permissions:
actions: write
contents: read
name: compose apks
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: GetStream/android-ci-actions/actions/setup-java@cb46e4f44d105a68738bfd2a1cfd156bb768665b
- uses: GetStream/android-ci-actions/actions/enable-kvm@cb46e4f44d105a68738bfd2a1cfd156bb768665b
- uses: GetStream/android-ci-actions/actions/setup-ruby@cb46e4f44d105a68738bfd2a1cfd156bb768665b
# Pull requests and the merge queue restore the latest cache; scheduled and manual runs save a new one.
- name: Restore Gradle cache
id: gradle_cache
uses: actions/cache/restore@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-e2e-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gradle-e2e-
- name: Build apks
run: bundle exec fastlane build_e2e_test
timeout-minutes: 30
- name: Save Gradle cache
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
uses: actions/cache/save@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ steps.gradle_cache.outputs.cache-primary-key }}
# Keeps one snapshot per branch, so the nightly saves don't pile up in the repo's Actions cache.
# A failed save only warns, so the older snapshots stay unless the new one is listed.
- name: Remove older Gradle caches
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
env:
GH_TOKEN: ${{ github.token }}
NEW_KEY: ${{ steps.gradle_cache.outputs.cache-primary-key }}
run: |
gh cache list -R "$GITHUB_REPOSITORY" --ref "$GITHUB_REF" --key "${{ runner.os }}-gradle-e2e-" --limit 100 --json id,key \
--jq 'if any(.[]; .key == env.NEW_KEY) then .[] | select(.key != env.NEW_KEY) | .id else empty end' \
| xargs -r -n1 gh cache delete -R "$GITHUB_REPOSITORY"
- name: Upload apks
uses: actions/upload-artifact@v7
with:
name: apks
path: |
demo-app/build/outputs/apk/e2etesting/debug/*.apk
demo-app/build/outputs/apk/androidTest/e2etesting/debug/*.apk