ci add mini tests
This commit is contained in:
parent
5eb53bcf1d
commit
3a714cf31e
2 changed files with 34 additions and 1 deletions
|
@ -1,15 +1,38 @@
|
|||
version: 2
|
||||
jobs:
|
||||
test:
|
||||
docker:
|
||||
- image: registry.gitlab.com/fdroid/ci-images-client:latest
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: gradle
|
||||
- run: export GRADLE_USER_HOME=$PWD/.gradle
|
||||
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
|
||||
- run: ./gradlew lint
|
||||
- save_cache:
|
||||
paths:
|
||||
- .gradle/caches
|
||||
- .gradle/wrapper
|
||||
key: gradle
|
||||
- store_artifacts:
|
||||
path: build/outputs/apk/standard
|
||||
destination: apk
|
||||
build:
|
||||
docker:
|
||||
- image: registry.gitlab.com/fdroid/ci-images-client:latest
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
|
||||
key: gradle
|
||||
- run: export GRADLE_USER_HOME=$PWD/.gradle
|
||||
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
|
||||
- run: ./gradlew assembleStandard
|
||||
- save_cache:
|
||||
paths:
|
||||
- .gradle/caches
|
||||
- .gradle/wrapper
|
||||
key: gradle
|
||||
- store_artifacts:
|
||||
path: build/outputs/apk/standard
|
||||
destination: apk
|
||||
|
@ -19,3 +42,4 @@ workflows:
|
|||
build_only:
|
||||
jobs:
|
||||
- build
|
||||
- test
|
||||
|
|
|
@ -7,6 +7,7 @@ cache:
|
|||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
|
||||
before_script:
|
||||
- export GRADLE_USER_HOME=$PWD/.gradle
|
||||
|
@ -22,6 +23,14 @@ build:
|
|||
paths:
|
||||
- build/outputs/
|
||||
|
||||
build:
|
||||
stage: test
|
||||
script:
|
||||
- ./gradlew lint
|
||||
artifacts:
|
||||
paths:
|
||||
- build/outputs/
|
||||
|
||||
after_script:
|
||||
# this file changes every time but should not be cached
|
||||
- rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
|
||||
|
|
Reference in a new issue