Split out CI jobs and only run them on changes

This commit is contained in:
Torsten Grote 2023-06-09 16:53:05 -03:00 committed by Hans-Christoph Steiner
parent 1974ed8dee
commit 7fd223c76d
1 changed files with 36 additions and 5 deletions

View File

@ -55,20 +55,41 @@ workflow:
after_script:
- echo "Download debug artifacts from https://gitlab.com/${CI_PROJECT_PATH}/-/jobs"
test_lint_pmd_checkstyle:
app test:
<<: *test-template
rules:
- changes:
- .gitlab-ci.yml
- build.gradle
- app/**/*
script:
# index-v1.jar tests need SHA1 support still, TODO use apksig to validate JAR sigs
- sed -i 's,SHA1 denyAfter 20[0-9][0-9],SHA1 denyAfter 2024,'
/usr/lib/jvm/default-java/conf/security/java.security
/usr/lib/jvm/default-java/conf/security/java.security
- ./gradlew :app:testFullDebugUnitTest
lint_pmd_checkstyle:
<<: *test-template
stage: lint
rules:
- changes:
- .gitlab-ci.yml
- build.gradle
- app/**/*
script:
# always report on lint errors to the build log
- sed -i -e 's,textReport .*,textReport true,' app/build.gradle
# the tasks "lint", "test", etc don't always include everything
- ./gradlew lint pmd checkstyle ktlintCheck testDebugUnitTest testFullDebugUnitTest
- ./gradlew lint pmd checkstyle ktlintCheck
tools scripts:
stage: lint
image: debian:bullseye-slim
rules:
- changes:
- .gitlab-ci.yml
- build.gradle
- app/**/*
script:
- apt-get update
- apt-get -qy install --no-install-recommends git python3
@ -104,14 +125,24 @@ weblate merge conflict:
errorprone:
extends: .base
stage: test
stage: lint
rules:
- changes:
- .gitlab-ci.yml
- build.gradle
- app/**/*
script:
- cat config/errorprone.gradle >> app/build.gradle
- ./gradlew -Dorg.gradle.dependency.verification=lenient assembleDebug
database schema:
stage: test
stage: lint
image: debian:bullseye-backports
rules:
- changes:
- .gitlab-ci.yml
- build.gradle
- libs/database/**/*
script:
- apt-get update
- apt-get -qy --no-install-recommends install default-jdk-headless git sdkmanager