2020-07-05 21:48:00 +00:00
|
|
|
|
name: Pull Request
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
|
|
jobs:
|
2020-08-29 18:26:36 +00:00
|
|
|
|
ktlint:
|
2020-07-05 21:48:00 +00:00
|
|
|
|
runs-on: ubuntu-latest
|
2020-08-29 18:26:36 +00:00
|
|
|
|
steps:
|
2022-03-04 00:03:04 +00:00
|
|
|
|
- uses: actions/checkout@v3
|
2021-08-07 01:41:30 +00:00
|
|
|
|
- name: Set up JDK 11
|
2022-12-16 15:18:39 +00:00
|
|
|
|
uses: actions/setup-java@v3.9.0
|
2020-08-29 18:26:36 +00:00
|
|
|
|
with:
|
2021-07-25 20:54:51 +00:00
|
|
|
|
distribution: 'adopt'
|
2021-08-07 01:41:30 +00:00
|
|
|
|
java-version: '11'
|
2020-08-29 18:26:36 +00:00
|
|
|
|
|
2022-03-23 00:18:21 +00:00
|
|
|
|
- uses: actions/cache@v3
|
2020-09-02 04:34:19 +00:00
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.gradle/caches
|
|
|
|
|
~/.gradle/wrapper
|
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
|
|
2020-08-29 18:26:36 +00:00
|
|
|
|
- name: Mock google-services.json
|
2020-12-28 03:04:37 +00:00
|
|
|
|
run: |
|
|
|
|
|
cp .github/mock-google-services.json app/google-services.json
|
|
|
|
|
cp .github/mock-google-services.json wear/google-services.json
|
2020-07-05 21:48:00 +00:00
|
|
|
|
|
2020-08-29 18:26:36 +00:00
|
|
|
|
- name: Validate ktlint
|
|
|
|
|
run: ./gradlew ktlintCheck
|
|
|
|
|
|
|
|
|
|
lint:
|
|
|
|
|
runs-on: ubuntu-latest
|
2020-07-05 21:48:00 +00:00
|
|
|
|
steps:
|
2022-03-04 00:03:04 +00:00
|
|
|
|
- uses: actions/checkout@v3
|
2021-08-07 01:41:30 +00:00
|
|
|
|
- name: Set up JDK 11
|
2022-12-16 15:18:39 +00:00
|
|
|
|
uses: actions/setup-java@v3.9.0
|
2020-08-29 18:26:36 +00:00
|
|
|
|
with:
|
2021-07-25 20:54:51 +00:00
|
|
|
|
distribution: 'adopt'
|
2021-08-07 01:41:30 +00:00
|
|
|
|
java-version: '11'
|
2020-08-29 18:26:36 +00:00
|
|
|
|
|
2022-03-23 00:18:21 +00:00
|
|
|
|
- uses: actions/cache@v3
|
2020-09-02 04:34:19 +00:00
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.gradle/caches
|
|
|
|
|
~/.gradle/wrapper
|
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
|
|
2020-08-29 18:26:36 +00:00
|
|
|
|
- name: Mock google-services.json
|
2020-12-28 03:04:37 +00:00
|
|
|
|
run: |
|
|
|
|
|
cp .github/mock-google-services.json app/google-services.json
|
|
|
|
|
cp .github/mock-google-services.json wear/google-services.json
|
2020-08-29 18:26:36 +00:00
|
|
|
|
|
|
|
|
|
- name: Validate Lint
|
|
|
|
|
run: ./gradlew lint
|
|
|
|
|
|
|
|
|
|
pr_build:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2022-03-04 00:03:04 +00:00
|
|
|
|
- uses: actions/checkout@v3
|
2021-02-22 03:03:16 +00:00
|
|
|
|
with:
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
2022-10-28 17:18:29 +00:00
|
|
|
|
- name: Check for modified DB schemas on branch
|
|
|
|
|
run: |
|
|
|
|
|
if git diff --name-only --diff-filter=DMR origin/master... | grep "^common/schemas"; then
|
|
|
|
|
echo -e "\n❌ Existing database schema modified, please increase the database version instead"
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
|
|
|
|
echo -e "\n✔️ No changed database schemas on branch"
|
|
|
|
|
fi
|
|
|
|
|
|
2021-08-07 01:41:30 +00:00
|
|
|
|
- name: Set up JDK 11
|
2022-12-16 15:18:39 +00:00
|
|
|
|
uses: actions/setup-java@v3.9.0
|
2020-07-05 21:48:00 +00:00
|
|
|
|
with:
|
2021-07-25 20:54:51 +00:00
|
|
|
|
distribution: 'adopt'
|
2021-08-07 01:41:30 +00:00
|
|
|
|
java-version: '11'
|
2020-09-02 04:34:19 +00:00
|
|
|
|
|
2022-03-23 00:18:21 +00:00
|
|
|
|
- uses: actions/cache@v3
|
2020-09-02 04:34:19 +00:00
|
|
|
|
with:
|
|
|
|
|
path: |
|
|
|
|
|
~/.gradle/caches
|
|
|
|
|
~/.gradle/wrapper
|
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
|
|
|
restore-keys: |
|
|
|
|
|
${{ runner.os }}-gradle-
|
|
|
|
|
|
2020-07-05 21:48:00 +00:00
|
|
|
|
- name: Mock google-services.json
|
2020-12-28 03:04:37 +00:00
|
|
|
|
run: |
|
|
|
|
|
cp .github/mock-google-services.json app/google-services.json
|
|
|
|
|
cp .github/mock-google-services.json wear/google-services.json
|
2020-07-05 21:48:00 +00:00
|
|
|
|
|
2021-02-22 03:03:16 +00:00
|
|
|
|
- uses: ./.github/actions/create-release-notes
|
|
|
|
|
name: Create Release Notes
|
|
|
|
|
|
2020-07-05 21:48:00 +00:00
|
|
|
|
- name: Build Debug APK
|
|
|
|
|
run: ./gradlew assembleDebug
|
2022-10-28 17:18:29 +00:00
|
|
|
|
|
|
|
|
|
- name: Check for missing/modified DB schemas after build
|
|
|
|
|
run: |
|
|
|
|
|
if [[ $(git status common/schemas --porcelain) ]]; then
|
|
|
|
|
echo $(git status common/schemas --porcelain)
|
|
|
|
|
echo -e "\n❌ Found uncommitted changes in database schema directory, please make sure to include all changes in your commit(s)"
|
|
|
|
|
exit 1;
|
|
|
|
|
else
|
|
|
|
|
echo -e "\n✔️ No changes in database schema directory after build"
|
|
|
|
|
fi
|
2020-07-05 21:48:00 +00:00
|
|
|
|
|
|
|
|
|
- name: Archive Debug Build
|
2022-11-22 20:25:42 +00:00
|
|
|
|
uses: actions/upload-artifact@v3
|
2020-07-05 21:48:00 +00:00
|
|
|
|
with:
|
2020-12-28 03:04:37 +00:00
|
|
|
|
path: ./**/*.apk
|