-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (71 loc) · 2.51 KB
/
firebase-and-slack.yml
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
62
63
64
65
66
67
68
69
70
71
72
on:
push:
branches:
- master
- develop
- 'feature/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: ./gradlew build assembleDebugAndroidTest # "build" includes lint and test.
- run: ./gradlew assembleRelease
- uses: actions/upload-artifact@v2
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- uses: actions/upload-artifact@v2
with:
name: app-debug-androidTest
path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
- uses: actions/upload-artifact@v2
with:
name: app-release-unsigned
path: app/build/outputs/apk/release/app-release-unsigned.apk
firebase-test-labs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: app-debug
- uses: actions/download-artifact@v2
with:
name: app-debug-androidTest
- run: ls -R # optional
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.SERVICE_ACCOUNT_KEY_BASE64 }}
- run: gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID }}
# Virtual devices have more quotas than physical devices.
# https://firebase.google.com/pricing
# Pixel 2 is the latest available virtual device.
# https://firebase.google.com/docs/test-lab/android/available-testing-devices
- run: gcloud firebase test android run --type instrumentation --app app-debug.apk --test app-debug-androidTest.apk --device model=Pixel2,version=29
- uses: 8398a7/action-slack@v2
with:
status: ${{ job.status }}
author_name: GitHub Actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically populated by GitHub
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
firebase-app-distribution:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: app-release-unsigned
- run: ls -R # optional
- uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
token: ${{ secrets.FIREBASE_TOKEN }}
groups: testers
file: app-release-unsigned.apk