Skip to content

Commit 7810025

Browse files
authored
ci: separate the GH actions workflows (#2704)
1 parent 17a3c91 commit 7810025

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

.github/workflows/build_branch.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: gradlew assemble
2+
3+
on:
4+
push:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
distribution: 'zulu'
20+
java-version: 17
21+
- name: Setup Gradle
22+
uses: gradle/gradle-build-action@v2
23+
- name: Check Snippets
24+
run: python scripts/checksnippets.py
25+
# TODO(thatfiredev): remove this once github.com/firebase/quickstart-android/issues/1672 is fixed
26+
- name: Remove Firebase Data Connect from CI
27+
run: python scripts/ci_remove_fdc.py
28+
- name: Copy mock google_services.json
29+
run: ./copy_mock_google_services_json.sh
30+
- name: Build with Gradle (Push)
31+
run: ./gradlew clean ktlint assemble

.github/workflows/android.yml renamed to .github/workflows/build_pull_request.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
name: Android CI
1+
name: build_pull_request.sh
22

33
on:
44
pull_request:
5-
push:
65

76
concurrency:
87
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
@@ -30,7 +29,3 @@ jobs:
3029
run: ./copy_mock_google_services_json.sh
3130
- name: Build with Gradle (Pull Request)
3231
run: ./build_pull_request.sh
33-
if: github.event_name == 'pull_request'
34-
- name: Build with Gradle (Push)
35-
run: ./gradlew clean ktlint assemble
36-
if: github.event_name != 'pull_request'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md)
3939
[![SAM Score][sam-score-badge]][sam-score]
4040

4141
[gh-actions]: https://github.com/firebase/quickstart-android/actions
42-
[gh-actions-badge]: https://github.com/firebase/quickstart-android/actions/workflows/android.yml/badge.svg?branch=master&event=push
42+
[gh-actions-badge]: https://github.com/firebase/quickstart-android/actions/workflows/build_branch.yml/badge.svg?branch=master&event=push
4343
[sam-score]: https://ossbot.computer/samscore.html
4444
[sam-score-badge]: https://ossbot.computer/samscorebadge?org=firebase&repo=quickstart-android

0 commit comments

Comments
 (0)