.gitlab-ci.yml 1.84 KB
Newer Older
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
1
image: mhart/alpine-node:10
Wietse Kuipers's avatar
Add CI    
Wietse Kuipers committed
2

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

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

Wietse Kuipers's avatar
Wietse Kuipers committed
10
eslint:
Luuk Scholten's avatar
Luuk Scholten committed
11
    stage: validate
Gijs Hendriksen's avatar
Gijs Hendriksen committed
12
    before_script:
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
13
        - apk update && apk add git
Gijs Hendriksen's avatar
Gijs Hendriksen committed
14
        - yarn install
15
    script:
16
        - yarn lint:ci
Luuk Scholten's avatar
Luuk Scholten committed
17
18
19

jest:
    stage: validate
Gijs Hendriksen's avatar
Gijs Hendriksen committed
20
    before_script:
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
21
        - apk update && apk add git
Gijs Hendriksen's avatar
Gijs Hendriksen committed
22
        - yarn install
Luuk Scholten's avatar
Luuk Scholten committed
23
24
    script:
        - yarn jest
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

# 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:
44
    image: thalia/android-react-native:latest
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
45
    stage: build
46
47
48
49
50
    cache:
      key: gradle cache
      paths:
          - $CI_PROJECT_DIR/.gradle/wrapper/
          - $CI_PROJECT_DIR/.gradle/caches/
51
    before_script:
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
52
        - sysctl fs.inotify.max_user_watches=524288
53
54
55
        - set +o pipefail
        - yes | /opt/android-sdk-linux/tools/bin/sdkmanager --licenses
        - set -o pipefail
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
56
        - apk update && apk add git
Gijs Hendriksen's avatar
Gijs Hendriksen committed
57
        - yarn install
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
58
    script:
59
60
        - echo $SENTRY_PROPS | base64 -d > ./android/sentry.properties
        - echo $PROD_ENV | base64 -d > .env
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
61
        - cd $CI_PROJECT_DIR/android/
62
        - ./gradlew --no-daemon ":app:assemble"
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
63
64
    artifacts:
        paths:
65
66
            - $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
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
67
            - $CI_PROJECT_DIR/android/app/build/outputs/apk/release/app-release.apk