Add database checks to PR workflow (#3000)

* Add database checks to PR workflow

* Update step names
This commit is contained in:
Joris Pelgröm 2022-10-28 19:18:29 +02:00 committed by GitHub
parent 209497e0a2
commit c7db22163e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,6 +66,15 @@ jobs:
with:
fetch-depth: 0
- 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
- name: Set up JDK 11
uses: actions/setup-java@v3.6.0
with:
@ -91,6 +100,16 @@ jobs:
- name: Build Debug APK
run: ./gradlew assembleDebug
- 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
- name: Archive Debug Build
uses: kittaakos/upload-artifact-as-is@v0