提交 c7e35498 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 88293333
image: "android-container:9.1"
variables:
# ANDROID_COMPILE_SDK: "25"
# ANDROID_BUILD_TOOLS: "24.0.0"
# ANDROID_SDK_TOOLS: "24.4.1"
image: "registry.cn-hangzhou.aliyuncs.com/engintime/android-container:latest"
before_script:
- ln -sf /cache_ln/cache/caches /cache/caches
- ln -sf /cache_ln/cache/daemon /cache/daemon
- ln -sf /cache_ln/cache/kotlin-profile /cache/kotlin-profile
- ln -sf /cache_ln/cache/motifications /cache/motifications
- ln -sf /cache_ln/cache/native /cache/native
- ln -sf /cache_ln/cache/notifications /cache/notifications
- ln -sf /cache_ln/cache/wrapper /cache/wrapper
- chmod +x ./gradlew
# - chmod +x ./waitfinish.sh
stages:
- code-analysis
- case1
- code-analysis
variables:
PACKAGE_NAME: "net.codecode.hideseek"
PACKAGE_PATH: "/net/codecode/hideseek/"
.codecode-runner: &codecode-runner
.android-runner: &android-runner
tags:
- ubuntu-16.04
- ubuntu-18.04
- long-job
- android-app
.codecode-analysis-runner: &codecode-analysis-runner
tags:
- ubuntu-16.04
- long-job
- android-app
# - code-analysis
code-analysis:
# image: "registry.cn-hangzhou.aliyuncs.com/engintime/ubuntu_16.04_program:latest"
stage: code-analysis
<<: *codecode-analysis-runner
script:
- ./gradlew assembleDebug --offline
- sonar-scanner -Dsonar.projectKey=ProjectKey-$CI_PROJECT_ID -Dsonar.projectName=$CI_PROJECT_NAME -Dsonar.links.homepage=$CI_PROJECT_URL -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.url=$CODECODE_PROTOCOL$CODECODE_DOMAIN
# - ./waitfinish.sh
allow_failure: true
only:
- master
- ubuntu-18.04
- short-job
- code-analysis
.codecode-runner: &codecode-runner
tags:
- ubuntu-16.04
- short-job
case1:
stage: case1
<<: *codecode-runner
<<: *android-runner
script:
- ./gradlew assembleDebug --offline --build-cache
- >
......@@ -60,15 +52,13 @@ case1:
- avdmanager create avd --force --name "test" --device "pixel" --package "system-images;android-30;google_apis;x86" > /dev/null
- emulator -memory 4096 -timezone Asia/Shang_Hai -avd "test" -no-boot-anim -no-window -gpu swiftshader_indirect -accel on -noaudio -no-snapshot-save -dns-server 8.8.8.8,8.8.4.4 -netfast -nojni &
# - emulator -memory 4096 -timezone Asia/Shang_Hai -avd "test" -no-boot-anim -no-window -gpu host -accel on -noaudio -no-snapshot-save -dns-server 8.8.8.8,8.8.4.4 -netfast -nojni &
- /android-wait-for-emulator.sh 20
- adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS
- sleep 3; adb shell input keyevent 22
- sleep 3; adb shell input keyevent 22
- sleep 3; adb shell input keyevent 66
- adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS
# - ./gradlew cAT --offline
- ./gradlew app:connectedAndroidTest -P android.testInstrumentationRunnerArguments.class=com.example.mysecondapp.ExampleInstrumentedTest#useAppContext --offline --build-cache
- ./gradlew app:connectedAndroidTest -P android.testInstrumentationRunnerArguments.class=${PACKAGE_NAME}.Work1Test#work1Test --offline --build-cache
- >
echo
......@@ -78,7 +68,7 @@ case1:
echo "==========================================="
- ./gradlew app:connectedAndroidTest -P android.testInstrumentationRunnerArguments.class=com.example.mysecondapp.ExampleKotlinTest#useEspressoTest --offline --build-cache
- ./gradlew app:connectedAndroidTest -P android.testInstrumentationRunnerArguments.class=${PACKAGE_NAME}.Work2Test#work2Test --offline --build-cache
- >
echo
......@@ -90,10 +80,6 @@ case1:
# artifacts:
# paths:
# - app/build/reports/androidTests/
teacher-check1:
image: "registry.cn-hangzhou.aliyuncs.com/engintime/alpine_git:latest"
stage: case1
......@@ -101,13 +87,23 @@ teacher-check1:
before_script: []
script:
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/app/src/androidTest/java/net/codecode/consciencefood/ExampleInstrumentedTest.kt app/src/androidTest/java/net/codecode/consciencefood/ExampleInstrumentedTest.kt -b -B -y -i --suppress-common-lines
- fileidentity.sh
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -i
- diff template/app/src/androidTest/java${PACKAGEPATH}Work1Test.kt app/src/androidTest/java${PACKAGE_PATH}Work1Test.kt -b -B -i
- diff template/app/src/androidTest/java${PACKAGEPATH}Work2Test.kt app/src/androidTest/java${PACKAGE_PATH}Work2Test.kt -b -B -i
only:
- master
when: manual
allow_failure: true
code-analysis:
stage: code-analysis
<<: *codecode-analysis-runner
script:
- ./gradlew assembleDebug --offline
- sonar-scanner -X -Dsonar.projectKey=ProjectKey-$CI_PROJECT_ID -Dsonar.projectName=$CI_PROJECT_NAME -Dsonar.links.homepage=$CI_PROJECT_URL -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.url=$CODECODE_PROTOCOL$CODECODE_DOMAIN
allow_failure: true
only:
- master
请教师用户首先访问[教师项目群组](https://www.codecode.net/engintime/android-app/teachers-packet),申请权限并审核通过后,再[domain relative url](engintime/android-app/Lab-Answer/HideSeek.git)访问本项目的参考答案
\ No newline at end of file
#sonar.projectKey=MySecondApp
#sonar.projectName=MySecondApp
#sonar.projectVersion=1.0
# Path to the parent source code directory.
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
# If not set, SonarQube starts looking for source code from the directory containing
sonar.language=java
# the sonar-project.properties file.
sonar.sources=app/src
# Encoding of the source code
sonar.sourceEncoding=UTF-8
# Additional parameters
#sonar.my.property=value
#sonar.java.binaries=app/build/intermediates/javac/debug/classes/com/example/mysecondapp
sonar.java.binaries=app/build/intermediates/javac/debug/classes
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论