Fakultas Ilmu Komputer UI

.gitlab-ci.yml 829 Bytes
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
wulanmantiri's avatar
wulanmantiri committed
12
13
  - build

14
15
16
17
18
test:
  stage: test
  before_script:
    - yarn install
  script:
19
    - yarn test --coverage --watchAll=false --verbose --collectCoverageFrom="src/**/*.tsx"
20

wulanmantiri's avatar
wulanmantiri committed
21
22
23
24
25
26
27
28
build:
  stage: build
  before_script:
    - yarn install
    - export ANDROID_SDK_ROOT=/usr/lib/android-sdk
  script:
    - cd android
    - chmod +x gradlew && ./gradlew assembleRelease
29
    - cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
wulanmantiri's avatar
wulanmantiri committed
30
31
32
  artifacts:
    name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
    paths:
33
34
35
36
      - $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
  except:
    changes:
      - "README.md"
wulanmantiri's avatar
wulanmantiri committed
37
38
39
  only:
    - staging
    - master