.gitlab-ci.yml 1.85 KB
Newer Older
1
image: node:8-alpine
Wietse Kuipers's avatar
Add CI  
Wietse Kuipers committed
2

3
4
5
variables:
    GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle

6
7
8
stages:
  - dependencies
  - validate
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
9
  - build
10

Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
11
yarn dependencies:
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    stage: dependencies
    cache:
        key: $CI_JOB_NAME
        paths:
            - $ARTIFACTS_PATH
            - $TOOL_CACHE_PATH
    artifacts:
        expire_in: 1 hour
        paths:
            - $ARTIFACTS_PATH
    script:
        - yarn install --lockfile-only
    variables:
        TOOL_CACHE_PATH: /usr/local/share/.cache/yarn/v1
        ARTIFACTS_PATH: node_modules
Wietse Kuipers's avatar
Add CI  
Wietse Kuipers committed
27

Wietse Kuipers's avatar
Wietse Kuipers committed
28
eslint:
Luuk Scholten's avatar
Luuk Scholten committed
29
    stage: validate
30
    script:
31
        - yarn lint:ci
Luuk Scholten's avatar
Luuk Scholten committed
32
33
34
35
36

jest:
    stage: validate
    script:
        - yarn jest
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

# We don't need this step as long as there are no tests for the native Android code
# test android:
#     stage: validate
#     script:
#         - cd $CI_PROJECT_DIR/android/
#         - gradle --no-daemon --continue ":app:testDebugUnitTest" ":app:testReleaseUnitTest"
#     cache:
#         key: $CI_JOB_NAME
#         paths:
#             - .gradle/wrapper/
#             - .gradle/caches/
#     artifacts:
#         expire_in: 1 hour
#         paths:
#             - .gradle/wrapper/
#             - .gradle/caches/

build android:
56
    image: thalia/android-react-native:latest
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
57
    stage: build
58
59
60
61
62
    cache:
      key: gradle cache
      paths:
          - $CI_PROJECT_DIR/.gradle/wrapper/
          - $CI_PROJECT_DIR/.gradle/caches/
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
63
    script:
64
65
        - echo $SENTRY_PROPS | base64 -d > ./android/sentry.properties
        - echo $PROD_ENV | base64 -d > .env
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
66
        - cd $CI_PROJECT_DIR/android/
67
        - ./gradlew --no-daemon ":app:assemble"
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
68
69
    artifacts:
        paths:
70
71
72
            - $CI_PROJECT_DIR/android/app/build/outputs/apk/debug/app-debug.apk
            - $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release-unsigned.apk
            - $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release.apk