mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2026-09-02 21:03:34 +03:00
ci: gate backend builds and cache priming (#7405)
# Description of Changes - Added a dedicated backend path filter for Java and Gradle-related changes. - Gated backend builds on backend-relevant file changes. - Limited Gradle cache priming to project changes. - Made Docker image tests resilient to skipped upstream jobs. - Included the Gradle cache prime job in the final CI status check. - Removed the unnecessary build dependency from the license check. --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### Translations (if applicable) - [ ] I ran [`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have run `task check` to verify linters, typechecks, and tests pass - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#7-testing) for more details.
This commit is contained in:
@@ -8,6 +8,7 @@ ci: &ci
|
|||||||
|
|
||||||
build: &build
|
build: &build
|
||||||
- *ci
|
- *ci
|
||||||
|
- buildSrc/**
|
||||||
- build.gradle
|
- build.gradle
|
||||||
- gradle/spotless.gradle
|
- gradle/spotless.gradle
|
||||||
- app/(common|core|proprietary|saas)/build.gradle
|
- app/(common|core|proprietary|saas)/build.gradle
|
||||||
@@ -15,6 +16,22 @@ build: &build
|
|||||||
- .taskfiles/backend.yml
|
- .taskfiles/backend.yml
|
||||||
- .github/workflows/check-licence.yml
|
- .github/workflows/check-licence.yml
|
||||||
|
|
||||||
|
# Backend build inputs. This is intentionally broader than `build`: Java and
|
||||||
|
# backend resource changes must exercise the backend matrix even when Gradle
|
||||||
|
# build scripts themselves are unchanged.
|
||||||
|
backend: &backend
|
||||||
|
- *ci
|
||||||
|
- *build
|
||||||
|
- gradle/**
|
||||||
|
- gradle.properties
|
||||||
|
- gradlew
|
||||||
|
- gradlew.bat
|
||||||
|
- settings.gradle
|
||||||
|
- app/(common|core|proprietary|saas)/src/(main|test)/java/**
|
||||||
|
- "app/(common|core|proprietary|saas)/src/(main|test)/resources/**/!(messages_*.properties|*.md)*"
|
||||||
|
- scripts/db-migration/**
|
||||||
|
- .github/workflows/backend-build.yml
|
||||||
|
|
||||||
openapi: &openapi
|
openapi: &openapi
|
||||||
- *ci
|
- *ci
|
||||||
- *build
|
- *build
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ jobs:
|
|||||||
timeout-minutes: 3
|
timeout-minutes: 3
|
||||||
outputs:
|
outputs:
|
||||||
build: ${{ steps.changes.outputs.build }}
|
build: ${{ steps.changes.outputs.build }}
|
||||||
|
backend: ${{ steps.changes.outputs.backend }}
|
||||||
project: ${{ steps.changes.outputs.project }}
|
project: ${{ steps.changes.outputs.project }}
|
||||||
openapi: ${{ steps.changes.outputs.openapi }}
|
openapi: ${{ steps.changes.outputs.openapi }}
|
||||||
frontend: ${{ steps.changes.outputs.frontend }}
|
frontend: ${{ steps.changes.outputs.frontend }}
|
||||||
@@ -65,6 +66,7 @@ jobs:
|
|||||||
name: ci-unsigned
|
name: ci-unsigned
|
||||||
deployment: false
|
deployment: false
|
||||||
name: Prime shared Gradle cache
|
name: Prime shared Gradle cache
|
||||||
|
if: needs.files-changed.outputs.project == 'true'
|
||||||
needs: [files-changed]
|
needs: [files-changed]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
@@ -118,6 +120,7 @@ jobs:
|
|||||||
key: ${{ steps.gradle-cache-key.outputs.key }}
|
key: ${{ steps.gradle-cache-key.outputs.key }}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
if: needs.files-changed.outputs.backend == 'true'
|
||||||
needs: [files-changed, gradle-cache-prime]
|
needs: [files-changed, gradle-cache-prime]
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
@@ -196,7 +199,7 @@ jobs:
|
|||||||
|
|
||||||
check-licence:
|
check-licence:
|
||||||
if: needs.files-changed.outputs.build == 'true'
|
if: needs.files-changed.outputs.build == 'true'
|
||||||
needs: [files-changed, build, gradle-cache-prime]
|
needs: [files-changed, gradle-cache-prime]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
uses: ./.github/workflows/check-licence.yml
|
uses: ./.github/workflows/check-licence.yml
|
||||||
@@ -215,7 +218,14 @@ jobs:
|
|||||||
docker-base-changed: ${{ needs.files-changed.outputs.docker-base }}
|
docker-base-changed: ${{ needs.files-changed.outputs.docker-base }}
|
||||||
|
|
||||||
test-build-docker-images:
|
test-build-docker-images:
|
||||||
if: github.event_name == 'pull_request' && needs.files-changed.outputs.project == 'true'
|
if: |
|
||||||
|
always() &&
|
||||||
|
github.event_name == 'pull_request' &&
|
||||||
|
needs.files-changed.outputs.project == 'true' &&
|
||||||
|
contains(fromJSON('["success", "skipped"]'), needs.gradle-cache-prime.result) &&
|
||||||
|
contains(fromJSON('["success", "skipped"]'), needs.build.result) &&
|
||||||
|
contains(fromJSON('["success", "skipped"]'), needs.check-generateOpenApiDocs.result) &&
|
||||||
|
contains(fromJSON('["success", "skipped"]'), needs.check-licence.result)
|
||||||
needs:
|
needs:
|
||||||
[
|
[
|
||||||
files-changed,
|
files-changed,
|
||||||
@@ -321,6 +331,7 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
needs:
|
needs:
|
||||||
- files-changed
|
- files-changed
|
||||||
|
- gradle-cache-prime
|
||||||
- build
|
- build
|
||||||
- db-migration-test
|
- db-migration-test
|
||||||
- check-generateOpenApiDocs
|
- check-generateOpenApiDocs
|
||||||
@@ -348,6 +359,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RESULTS: |
|
RESULTS: |
|
||||||
files-changed=${{ needs.files-changed.result }}
|
files-changed=${{ needs.files-changed.result }}
|
||||||
|
gradle-cache-prime=${{ needs.gradle-cache-prime.result }}
|
||||||
build=${{ needs.build.result }}
|
build=${{ needs.build.result }}
|
||||||
db-migration-test=${{ needs.db-migration-test.result }}
|
db-migration-test=${{ needs.db-migration-test.result }}
|
||||||
check-generateOpenApiDocs=${{ needs.check-generateOpenApiDocs.result }}
|
check-generateOpenApiDocs=${{ needs.check-generateOpenApiDocs.result }}
|
||||||
|
|||||||
Reference in New Issue
Block a user