2021-02-21 04:02:20 +00:00
|
|
|
name: Android CI
|
|
|
|
|
|
|
|
on:
|
2023-09-29 14:03:17 +00:00
|
|
|
pull_request:
|
2021-02-21 04:02:20 +00:00
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
2023-09-29 14:29:23 +00:00
|
|
|
validate:
|
2021-02-21 04:02:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-09-29 14:29:23 +00:00
|
|
|
name: Validate
|
2021-02-21 04:02:20 +00:00
|
|
|
steps:
|
2024-08-03 08:01:45 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-10-30 03:41:16 +00:00
|
|
|
- name: set up JDK
|
2024-08-03 08:01:54 +00:00
|
|
|
uses: actions/setup-java@v4
|
2021-02-21 04:02:20 +00:00
|
|
|
with:
|
2022-10-30 03:41:16 +00:00
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '17'
|
2023-09-29 14:03:17 +00:00
|
|
|
- name: Validate Gradle Wrapper
|
2024-08-06 11:02:37 +00:00
|
|
|
uses: gradle/wrapper-validation-action@v3
|
2023-10-01 03:45:32 +00:00
|
|
|
- name: Enable auto-merge
|
2023-12-16 02:32:30 +00:00
|
|
|
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot' }}
|
|
|
|
run: gh pr merge --auto --rebase "$PR_URL"
|
2023-10-01 03:45:32 +00:00
|
|
|
env:
|
|
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
2023-09-29 14:03:17 +00:00
|
|
|
unit_test:
|
|
|
|
name: Run Unit Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
2023-09-29 14:29:23 +00:00
|
|
|
- validate
|
2023-09-29 14:03:17 +00:00
|
|
|
steps:
|
2024-08-03 08:01:45 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-29 14:16:16 +00:00
|
|
|
- name: set up JDK
|
2024-08-03 08:01:54 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-09-29 14:16:16 +00:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '17'
|
|
|
|
- name: Run unit tests
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
arguments: testPlayDebugUnitTest
|
2023-10-01 03:45:22 +00:00
|
|
|
- name: Publish JUnit Results
|
|
|
|
uses: dorny/test-reporter@v1
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: Unit Test Results
|
2023-12-16 02:45:12 +00:00
|
|
|
path: "*/build/test-results/*/*.xml"
|
2023-10-01 03:45:22 +00:00
|
|
|
reporter: java-junit
|
|
|
|
fail-on-error: true
|
2023-09-29 14:03:17 +00:00
|
|
|
ui_tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Run UI Tests
|
|
|
|
needs:
|
2023-09-29 14:29:23 +00:00
|
|
|
- validate
|
2023-09-29 14:03:17 +00:00
|
|
|
steps:
|
2024-08-03 08:01:45 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-29 14:16:16 +00:00
|
|
|
- name: set up JDK
|
2024-08-03 08:01:54 +00:00
|
|
|
uses: actions/setup-java@v4
|
2023-09-29 14:16:16 +00:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '17'
|
2023-09-29 14:29:23 +00:00
|
|
|
- name: Build with Gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
arguments: assemblePlayDebug assemblePlayDebugAndroidTest
|
2023-09-29 14:16:16 +00:00
|
|
|
- name: Grant execute permission for flank_auth.sh
|
|
|
|
run: chmod +x flank_auth.sh
|
|
|
|
- name: Add auth for flank
|
|
|
|
env:
|
|
|
|
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
|
|
|
|
run: |
|
|
|
|
./flank_auth.sh
|
|
|
|
- name: Run UI tests
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
2023-12-16 02:32:30 +00:00
|
|
|
arguments: runFlank
|