diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5db5e7677..7e579727b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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