Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.22 KB
Newer Older
wulanmantiri's avatar
wulanmantiri committed
1
2
3
4
5
6
7
8
9
10
image: reactnativecommunity/react-native-android

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - node_modules/
    - android/
    - ios/

stages:
11
  - test
Wulan Mantiri's avatar
Wulan Mantiri committed
12
  - sonar-scanner
wulanmantiri's avatar
wulanmantiri committed
13
14
  - build

15
lint-test:
16
17
18
19
  stage: test
  before_script:
    - yarn install
  script:
20
    - yarn lint
21
    - yarn test --coverage --watchAll=false --verbose --collectCoverageFrom="src/**/*.tsx"
22
23
24
  artifacts:
    paths:
      - coverage
25

Wulan Mantiri's avatar
Wulan Mantiri committed
26
27
28
sonar-scanner:
  image:
    name: sonarsource/sonar-scanner-cli:latest
29
    entrypoint: ['']
Wulan Mantiri's avatar
Wulan Mantiri committed
30
31
32
33
34
35
36
37
  stage: sonar-scanner
  script:
    - sonar-scanner
      -Dsonar.host.url=$SONARQUBE_URL
      -Dsonar.login=$SONARQUBE_TOKEN
      -Dsonar.branch.name=$CI_COMMIT_REF_NAME
      -Dsonar.projectKey=$SONARQUBE_PROJECT_KEY

Wulan Mantiri's avatar
Wulan Mantiri committed
38
android:
wulanmantiri's avatar
wulanmantiri committed
39
40
41
42
43
44
  stage: build
  before_script:
    - yarn install
    - export ANDROID_SDK_ROOT=/usr/lib/android-sdk
  script:
    - cd android
Wulan Mantiri's avatar
Wulan Mantiri committed
45
    - chmod +x gradlew && ./gradlew clean && ./gradlew assembleRelease
46
    - cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
wulanmantiri's avatar
wulanmantiri committed
47
  artifacts:
48
    name: '$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME'
wulanmantiri's avatar
wulanmantiri committed
49
    paths:
50
51
52
      - $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
  except:
    changes:
53
      - 'README.md'
wulanmantiri's avatar
wulanmantiri committed
54
55
56
  only:
    - staging
    - master